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