diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 81391e796b9..4d0a73cb4d3 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -150,7 +150,7 @@
- + @@ -260,7 +260,7 @@ - + diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 44a57c2e11d..0c0941c715a 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -452,6 +452,24 @@ class account_invoice(osv.osv): _('Can not select currency that is not related to current company.\nPlease select accordingly !.')) return {} + def onchange_journal_id(self, cr, uid, ids, journal_id, company_id): + result = {} + if journal_id and company_id: + company = self.pool.get('res.company').browse(cr, uid, company_id) + journal_id = self.pool.get('account.journal').browse(cr, uid, journal_id) + if journal_id.currency: + result = {'value': { + 'currency_id': journal_id.currency.id + } + } + else: + result = {'value': { + 'currency_id': company.currency_id.id + } + } + + return result + def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice): if not payment_term_id: return {}