From 20c1de639e2e48ade0603144ac7dcf5e94c9a523 Mon Sep 17 00:00:00 2001 From: Benoit Aimont Date: Thu, 30 Oct 2025 15:04:36 +0100 Subject: [PATCH] [FIX] account_check_deposit - fix stacktrace when no account_journal_payment_debit_account found --- .../models/account_check_deposit.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/account_check_deposit/models/account_check_deposit.py b/account_check_deposit/models/account_check_deposit.py index d006a90b5da..a4a26aaadb4 100644 --- a/account_check_deposit/models/account_check_deposit.py +++ b/account_check_deposit/models/account_check_deposit.py @@ -242,22 +242,22 @@ def _prepare_move_vals(self): total_debit = self.company_id.currency_id.round(total_debit) total_amount_currency = self.currency_id.round(total_amount_currency) - counterpart_account_id = False + counterpart_account = False for line in self.bank_journal_id.inbound_payment_method_line_ids: if line.payment_method_id.code == "manual" and line.payment_account_id: - counterpart_account_id = line.payment_account_id.id + counterpart_account = line.payment_account_id break # inspired by _get_outstanding_account() on account.payment - if not counterpart_account_id: + if not counterpart_account: chart_template = self.with_context( allowed_company_ids=self.company_id.root_id.ids ).env["account.chart.template"] - counterpart_account_id = chart_template.ref( + counterpart_account = chart_template.ref( "account_journal_payment_debit_account_id", raise_if_not_found=False - ).id - if not counterpart_account_id: - counterpart_account_id = self.company_id.transfer_account_id.id - if not counterpart_account_id: + ) + if not counterpart_account: + counterpart_account = self.company_id.transfer_account_id + if not counterpart_account: raise UserError( _("Missing 'Internal Transfer' account on the company '%s'.") % self.company_id.display_name @@ -284,7 +284,7 @@ def _prepare_move_vals(self): 0, 0, { - "account_id": counterpart_account_id, + "account_id": counterpart_account.id, "partner_id": False, "debit": total_debit, "currency_id": self.currency_id.id,