From 59191db574db9a0bafce65836d80f4be578b945d Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 7 Dec 2011 17:15:55 +0100 Subject: [PATCH] [FIX] account_voucher: fixed onchange_partner_id when no journal_id is given bzr revid: qdp-launchpad@openerp.com-20111207161555-iatt11l2p3yynfzt --- addons/account_voucher/account_voucher.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index f751a154a42..535f76b8d64 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -511,6 +511,8 @@ class account_voucher(osv.osv): return vals def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context=None): + if not journal_id: + return {} res = self.recompute_voucher_lines(cr, uid, ids, partner_id, journal_id, amount, currency_id, ttype, date, context=context) vals = self.recompute_payment_rate(cr, uid, ids, res, currency_id, date, ttype, journal_id, amount, context=context) for key in vals.keys():