From 6246bd0401d229bc062016c27be80e9267999bde Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 14 May 2012 17:20:13 +0530 Subject: [PATCH] [IMP] improved code. bzr revid: tpa@tinyerp.com-20120514115013-6fofhsvmmrjfj707 --- addons/sale/wizard/sale_make_invoice_advance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index c8c1c3b9c6a..237d0254a1a 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -110,10 +110,11 @@ class sale_advance_payment_inv(osv.osv_memory): context=context) account_id = prop and prop.id or False account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, sale.fiscal_position.id or False, account_id) - res['account_id'] = account_id - if not res.get('account_id'): + if not account_id: raise osv.except_osv(_('Configuration Error !'), _('There is no income account defined as global property.')) + else: + res['account_id'] = account_id if not res.get('account_id'): raise osv.except_osv(_('Configuration Error !'),