From d413b86477bf2c4e1400e725991b52e7ee13b146 Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Thu, 13 Jan 2011 14:10:40 +0530 Subject: [PATCH] [FIX] account_voucher: Payment Invoice will set journal depending the currency in Invoice lp bug: https://launchpad.net/bugs/697080 fixed bzr revid: psi@tinyerp.co.in-20110113084040-ote1ekt0u5ui36hz --- addons/account_voucher/account_voucher.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index f59ff79a20d..2e8536b1097 100755 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -45,6 +45,11 @@ class account_voucher(osv.osv): def _get_journal(self, cr, uid, context=None): if context is None: context = {} journal_pool = self.pool.get('account.journal') + invoice_pool = self.pool.get('account.invoice') + if context.get('invoice_id', False): + currency_id = invoice_pool.browse(cr, uid, context.get('invoice_id'), context=context).currency_id.id + journal_id = journal_pool.search(cr, uid, [('currency', '=', currency_id)], limit=1) + return journal_id and journal_id[0] or False if context.get('journal_id', False): return context.get('journal_id') if not context.get('journal_id', False) and context.get('search_default_journal_id', False):