From babb4c887c07e95107e6e3280ab81a27e30a21cc Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Tue, 3 Jan 2012 17:59:52 +0530 Subject: [PATCH] [FIX] account_voucher : onchange_journal() takes at least 12 arguments (10 given). lp bug: https://launchpad.net/bugs/911159 fixed bzr revid: mdi@tinyerp.com-20120103122952-liuwdin1lx9gva59 --- addons/account_voucher/account_voucher.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 52eb779bfb1..71d47513ced 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -448,7 +448,9 @@ class account_voucher(osv.osv): default['value']['account_id'] = account_id default['value']['type'] = ttype or tr_type - vals = self.onchange_journal(cr, uid, ids, journal_id, line_ids, tax_id, partner_id, company_id, context) + date = time.strftime('%Y-%m-%d') + amount = 0.0 + vals = self.onchange_journal(cr, uid, ids, journal_id, line_ids, tax_id, partner_id, date, amount, ttype, company_id, context) default['value'].update(vals.get('value')) return default @@ -1051,7 +1053,7 @@ class account_voucher(osv.osv): voucher_currency = voucher_brw.currency_id and voucher_brw.currency_id.id or voucher_brw.journal_id.company_id.currency_id.id # We want to set it on the account move line as soon as the original line had a foreign currency if line.move_line_id.currency_id and line.move_line_id.currency_id.id != company_currency: - # we compute the amount in that foreign currency. + # we compute the amount in that foreign currency. if line.move_line_id.currency_id.id == current_currency: # if the voucher and the voucher line share the same currency, there is no computation to do sign = (move_line['debit'] - move_line['credit']) < 0 and -1 or 1 @@ -1270,7 +1272,7 @@ class account_voucher_line(osv.osv): def _currency_id(self, cr, uid, ids, name, args, context=None): ''' - This function returns the currency id of a voucher line. It's either the currency of the + This function returns the currency id of a voucher line. It's either the currency of the associated move line (if any) or the currency of the voucher or the company currency. ''' res = {}