[FIX] account_anglo_saxon: default account value

The default account value set for purchases invoices
lines for product of type Service was wrong: It used
the stock account, which is wrong as a Service
as no stock. Instead, it should left the product
expense account, as usual.

opw-676110
This commit is contained in:
Denis Ledoux 2016-05-09 17:35:18 +02:00
parent 88749790d1
commit 3954affc30
1 changed files with 8 additions and 7 deletions

View File

@ -50,6 +50,7 @@ class account_invoice_line(osv.osv):
return res
if type in ('in_invoice','in_refund'):
product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context)
if product_obj.type in ('consu', 'product'):
oa = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id
if not oa:
oa = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id