[FIX] account_anglo_saxon: do not put stock accounts on services
Services are not moved in stock so invoices created from stock.picking should not use stock accounts, same when creating lines for sales. opw 615263
This commit is contained in:
parent
f63acd9902
commit
74f18581f1
|
@ -77,7 +77,7 @@ class account_invoice_line(osv.osv):
|
|||
inv = i_line.invoice_id
|
||||
company_currency = inv.company_id.currency_id.id
|
||||
|
||||
if i_line.product_id and i_line.product_id.valuation == 'real_time':
|
||||
if i_line.product_id.type != 'service' and i_line.product_id.valuation == 'real_time':
|
||||
# debit account dacc will be the output account
|
||||
# first check the product, if empty check the category
|
||||
dacc = i_line.product_id.property_stock_account_output and i_line.product_id.property_stock_account_output.id
|
||||
|
|
|
@ -44,7 +44,7 @@ class stock_picking(osv.osv):
|
|||
if type in ('in_invoice', 'in_refund'):
|
||||
for inv in self.pool.get('account.invoice').browse(cr, uid, res, context=context):
|
||||
for ol in inv.invoice_line:
|
||||
if ol.product_id:
|
||||
if ol.product_id.type != 'service':
|
||||
oa = ol.product_id.property_stock_account_input and ol.product_id.property_stock_account_input.id
|
||||
if not oa:
|
||||
oa = ol.product_id.categ_id.property_stock_account_input_categ and ol.product_id.categ_id.property_stock_account_input_categ.id
|
||||
|
|
Loading…
Reference in New Issue