initial bug-fix for the voucher entry
bzr revid: mga@tinyerp.com-20081206131805-p352xscr1ccxeyh6
This commit is contained in:
parent
44b7f72b5b
commit
a2798d4030
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<terp>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<report id="report_account_voucher"
|
||||
string="Voucher Report (Cr/Dr)"
|
||||
string="Voucher Report"
|
||||
model="account.voucher"
|
||||
name="voucher.cash_receipt"
|
||||
rml="account_voucher/report/report_voucher.rml"
|
||||
|
@ -11,15 +11,14 @@
|
|||
header = "False"
|
||||
menu="True"/>
|
||||
|
||||
|
||||
<report id="report_account_voucher_amt"
|
||||
string="Voucher Report"
|
||||
model="account.voucher"
|
||||
name="voucher.cash_amount"
|
||||
rml="account_voucher/report/report_voucher_amount.rml"
|
||||
auto="False"
|
||||
header = "False"
|
||||
menu="True"/>
|
||||
<!-- <report id="report_account_voucher_amt"-->
|
||||
<!-- string="Voucher Report"-->
|
||||
<!-- model="account.voucher"-->
|
||||
<!-- name="voucher.cash_amount"-->
|
||||
<!-- rml="account_voucher/report/report_voucher_amount.rml"-->
|
||||
<!-- auto="False"-->
|
||||
<!-- header = "False"-->
|
||||
<!-- menu="True"/>-->
|
||||
|
||||
</data>
|
||||
</terp>
|
||||
</openerp>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terp>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<wizard
|
||||
|
@ -17,4 +17,4 @@
|
|||
type="wizard"
|
||||
/>
|
||||
</data>
|
||||
</terp>
|
||||
</openerp>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terp>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="wkf_voucher" model="workflow">
|
||||
|
@ -72,4 +72,4 @@
|
|||
<field name="signal">open_voucher</field>
|
||||
</record>
|
||||
</data>
|
||||
</terp>
|
||||
</openerp>
|
|
@ -180,7 +180,7 @@
|
|||
<blockTable colWidths="251.0,110.0,115.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11">[[ (move_ids.partner_id and move_ids.partner_id.name) or '']] :</para>
|
||||
<para style="P11">[[ (move_ids.partner_id and move_ids.partner_id.name) or 'Account']] :</para>
|
||||
<para style="P28">[[ move_ids.account_id.name ]] </para>
|
||||
<para style="P31">[[ get_ref(voucher.id,move_ids) ]]</para>
|
||||
</td>
|
||||
|
|
|
@ -29,6 +29,16 @@ from mx.DateTime import RelativeDateTime
|
|||
|
||||
from tools import config
|
||||
|
||||
type2journal = {
|
||||
'rec_voucher':'cash',
|
||||
'bank_rec_voucher':'cash',
|
||||
'pay_voucher': 'cash',
|
||||
'bank_pay_voucher':'cash',
|
||||
'cont_voucher':'cash',
|
||||
'journal_sale_voucher':'sale',
|
||||
'journal_pur_voucher':'purchase'
|
||||
}
|
||||
|
||||
class account_voucher(osv.osv):
|
||||
def _get_period(self, cr, uid, context):
|
||||
periods = self.pool.get('account.period').find(cr, uid)
|
||||
|
@ -45,9 +55,9 @@ class account_voucher(osv.osv):
|
|||
return [('none', 'Free Reference')]
|
||||
|
||||
def _get_journal(self, cr, uid, context):
|
||||
type_inv = context #.get('type', 'rec_voucher')
|
||||
type2journal = {'rec_voucher': 'cash', 'bank_rec_voucher': 'cash','pay_voucher': 'cash','bank_pay_voucher': 'cash', 'cont_voucher': 'cash','journal_sale_voucher': 'sale','journal_pur_voucher': 'purchase' }
|
||||
type_inv = context.get('type', 'rec_voucher')
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
res = False
|
||||
res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'cash'))], limit=1)
|
||||
if res:
|
||||
return res[0]
|
||||
|
@ -99,18 +109,6 @@ class account_voucher(osv.osv):
|
|||
'move_ids':fields.many2many('account.move.line', 'voucher_id', 'account_id', 'rel_account_move', 'Real Entry'),
|
||||
}
|
||||
|
||||
# def get_bank(self, cr, uid, context={}):
|
||||
# type = context.get('type', 'bank_payment')
|
||||
# journal = self.pool.get('account.journal')
|
||||
# if type == 'bank_payment':
|
||||
# id = journal.search(cr, uid, [('name','ilike','Bank')])
|
||||
# return id
|
||||
# elif type == 'cash_payment':
|
||||
# id = journal.search(cr, uid, [('name','ilike','Cash')])
|
||||
# return id
|
||||
#
|
||||
# return 3
|
||||
|
||||
_defaults = {
|
||||
#'journal_id':get_bank,
|
||||
'state': lambda *a: 'draft',
|
||||
|
@ -123,8 +121,6 @@ class account_voucher(osv.osv):
|
|||
self.pool.get('res.users').browse(cr, uid, uid,
|
||||
context=context).company_id.id,
|
||||
'currency_id': _get_currency,
|
||||
|
||||
|
||||
}
|
||||
|
||||
def _get_analytic_lines(self, cr, uid, id):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terp>
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_voucher_tree">
|
||||
<field name="name">account.voucher.tree</field>
|
||||
|
@ -293,4 +293,4 @@
|
|||
<menuitem name="Financial Management/Voucher Entries/Other Vouchers/Journal Purchase Voucher" id="menu_action_view_jour_pur_voucher_form" action="action_view_jour_pur_voucher_form"/>
|
||||
|
||||
</data>
|
||||
</terp>
|
||||
</openerp>
|
Loading…
Reference in New Issue