[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:
parent
88749790d1
commit
3954affc30
|
@ -50,13 +50,14 @@ class account_invoice_line(osv.osv):
|
||||||
return res
|
return res
|
||||||
if type in ('in_invoice','in_refund'):
|
if type in ('in_invoice','in_refund'):
|
||||||
product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context)
|
product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context)
|
||||||
oa = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id
|
if product_obj.type in ('consu', 'product'):
|
||||||
if not oa:
|
oa = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id
|
||||||
oa = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id
|
if not oa:
|
||||||
if oa:
|
oa = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id
|
||||||
fpos = fposition_id and fiscal_pool.browse(cr, uid, fposition_id, context=context) or False
|
if oa:
|
||||||
a = fiscal_pool.map_account(cr, uid, fpos, oa)
|
fpos = fposition_id and fiscal_pool.browse(cr, uid, fposition_id, context=context) or False
|
||||||
res['value'].update({'account_id':a})
|
a = fiscal_pool.map_account(cr, uid, fpos, oa)
|
||||||
|
res['value'].update({'account_id':a})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def _get_price(self, cr, uid, inv, company_currency, i_line, price_unit):
|
def _get_price(self, cr, uid, inv, company_currency, i_line, price_unit):
|
||||||
|
|
Loading…
Reference in New Issue