From 74f18581f1bb64f20fad974c8625a91420b57af4 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 18 Dec 2014 17:09:14 +0100 Subject: [PATCH] [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 --- addons/account_anglo_saxon/invoice.py | 2 +- addons/account_anglo_saxon/stock.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_anglo_saxon/invoice.py b/addons/account_anglo_saxon/invoice.py index 5465edf380d..4acbd348eb8 100644 --- a/addons/account_anglo_saxon/invoice.py +++ b/addons/account_anglo_saxon/invoice.py @@ -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 diff --git a/addons/account_anglo_saxon/stock.py b/addons/account_anglo_saxon/stock.py index e646bb17c0d..cfa35b47627 100644 --- a/addons/account_anglo_saxon/stock.py +++ b/addons/account_anglo_saxon/stock.py @@ -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