From 5b7264282b8ab93d6d0119460684a550cd1f2d69 Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Fri, 17 Sep 2010 16:21:13 +0200 Subject: [PATCH] [FIX] account: corrected company_currency usage bzr revid: qdp-launchpad@tinyerp.com-20100917142113-e26tz8py9optgnzb --- addons/account/invoice.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 27a3b889ff0..559070450c9 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -453,19 +453,14 @@ class account_invoice(osv.osv): return {} def onchange_journal_id(self, cr, uid, ids, journal_id): + result = {} if journal_id: journal = self.pool.get('account.journal').browse(cr, uid, journal_id) - if journal.currency: - result = {'value': { - 'currency_id': journal.currency.id + currency_id = journal.currency and journal.currency.id or journal.company_id.currency_id.id + result = {'value': { + 'currency_id': currency_id, } } - return result - user_company = self.pool.get('res.users').browse(cr, uid, [uid])[0].company_id - result = {'value': { - 'currency_id': user_company.currency_id.id - } - } return result def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice):