From e9d6dcf16f1696cfb3d934c0196ace38af5fae4c Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 29 May 2017 13:06:43 +0200 Subject: [PATCH] [FIX] stock_account: get_invoice_line_account in valuation = 'periodic' Let's consider the product category PC in valuation = 'periodic' and the product P with the category PC. When creating a vendor bill with P, the account on line doesn't have to be the stock input account but the expense account. opw:744409 --- addons/stock_account/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_account/models/account_invoice.py b/addons/stock_account/models/account_invoice.py index 510fc2daf8d..6291da2922f 100644 --- a/addons/stock_account/models/account_invoice.py +++ b/addons/stock_account/models/account_invoice.py @@ -99,6 +99,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) - if accounts['stock_input']: + if product.categ_id.property_valuation != 'manual_periodic' and accounts['stock_input']: return accounts['stock_input'] return super(AccountInvoiceLine, self).get_invoice_line_account(type, product, fpos, company)