[FIX] Sale : Better error message when account is missing from SOL for Invioce

lp bug: https://launchpad.net/bugs/449583 fixed

bzr revid: jvo@tinyerp.com-20091013144538-2k7w8zug6xvf3nsd
This commit is contained in:
Jay (Open ERP) 2009-10-13 20:15:38 +05:30
parent 6b9040ca8d
commit e25cb298e0
1 changed files with 3 additions and 0 deletions

View File

@ -818,6 +818,9 @@ class sale_order_line(osv.osv):
int(config['price_accuracy']))
fpos = line.order_id.fiscal_position or False
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, a)
if not a:
raise osv.except_osv(_('Error !'),
_('There is no income category account defined in default Properties for Product Category or Fiscal Position is not defined !'))
inv_id = self.pool.get('account.invoice.line').create(cr, uid, {
'name': line.name,
'origin': line.order_id.name,