From f8db92e278f7a73c12fc40835316fcbfa0bb36ad Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 9 Dec 2016 14:49:43 +0100 Subject: [PATCH] [IMP] stock_account: anglo-saxon stock input->expense->default Before this commit, in anglo-saxon accounting the account of a vendor's bill line was defined as the stock input account, or the default account. With this commit the chain becomes: - if one: stock input account, - else if one: expense account, - else: default account opw-695167 --- addons/stock_account/models/account_invoice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/stock_account/models/account_invoice.py b/addons/stock_account/models/account_invoice.py index e6c4d8c135d..892fd8ed2e1 100644 --- a/addons/stock_account/models/account_invoice.py +++ b/addons/stock_account/models/account_invoice.py @@ -89,5 +89,6 @@ class AccountInvoiceLine(models.Model): def get_invoice_line_account(self, type, product, fpos, company): if company.anglo_saxon_accounting and type in ('in_invoice', 'in_refund') and product and product.type == 'product': accounts = product.product_tmpl_id.get_product_accounts(fiscal_pos=fpos) - return accounts['stock_input'] + if accounts['stock_input']: + return accounts['stock_input'] return super(AccountInvoiceLine, self).get_invoice_line_account(type, product, fpos, company)