From ae69f2849b9d1ce93df16a080dd7ef7917116c90 Mon Sep 17 00:00:00 2001 From: Daniel Dico Date: Wed, 30 Sep 2015 20:55:36 -0400 Subject: [PATCH] [FIX] stock_account: use fiscal position to map account Closes #8813 --- addons/stock_account/stock_account.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/stock_account/stock_account.py b/addons/stock_account/stock_account.py index b31199ff4e9..16710bf24b9 100644 --- a/addons/stock_account/stock_account.py +++ b/addons/stock_account/stock_account.py @@ -74,7 +74,8 @@ class account_invoice(osv.osv): # debit account dacc will be the output account dacc = accounts['stock_output'].id # credit account cacc will be the expense account - cacc = accounts['expense'].id + fpos = i_line.invoice_id.fiscal_position_id + cacc = fpos.map_account(accounts['expense']).id if dacc and cacc: price_unit = i_line._get_anglo_saxon_price_unit() return [