account: add test for expence account in analytic line
bzr revid: ced-95e77f7f90068d522adc4af256c235e4b4785cef
This commit is contained in:
parent
644b7231fe
commit
0a31058c9a
|
@ -77,6 +77,8 @@ class account_analytic_line(osv.osv):
|
|||
a = prod.product_tmpl_id.property_account_expense
|
||||
if not a:
|
||||
a = prod.categ_id.property_account_expense_categ
|
||||
if not a:
|
||||
raise osv.except_osv('Error !', 'There is no expense account define for this product: "%s" (id:%d)' % (prod.name, prod.id,))
|
||||
return {'value' : {'amount' : -round(unit_amount * prod.standard_price * rate,2), 'general_account_id':a[0]}}
|
||||
return {}
|
||||
|
||||
|
|
Loading…
Reference in New Issue