From 5f3b368a1ce7a1eeadae73ac29fb0052dac2e8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Tue, 8 Feb 2022 16:13:03 +0100 Subject: [PATCH] [FIX] stock_account_prepare_anglo_saxon_out_lines_hook: update hook Apply https://github.com/odoo/odoo/commit/fe932dd2ac23ddb83a14c5b7044eb2cc326e2958 --- stock_account_prepare_anglo_saxon_out_lines_hook/hooks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stock_account_prepare_anglo_saxon_out_lines_hook/hooks.py b/stock_account_prepare_anglo_saxon_out_lines_hook/hooks.py index 45589e0a5..07cdbf8d9 100644 --- a/stock_account_prepare_anglo_saxon_out_lines_hook/hooks.py +++ b/stock_account_prepare_anglo_saxon_out_lines_hook/hooks.py @@ -32,13 +32,13 @@ def post_load_hook(): debit_interim_account = accounts["stock_output"] credit_expense_account = accounts["expense"] if not credit_expense_account: - if self.type == "out_refund": + if move.type == "out_refund": credit_expense_account = ( - self.journal_id.default_credit_account_id + move.journal_id.default_credit_account_id ) else: # out_invoice/out_receipt credit_expense_account = ( - self.journal_id.default_debit_account_id + move.journal_id.default_debit_account_id ) if not debit_interim_account or not credit_expense_account: continue