[IMP] improved code.

bzr revid: tpa@tinyerp.com-20120514115013-6fofhsvmmrjfj707
This commit is contained in:
Turkesh Patel (Open ERP) 2012-05-14 17:20:13 +05:30
parent 3536f26779
commit 6246bd0401
1 changed files with 3 additions and 2 deletions

View File

@ -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 !'),