From d7d02c44c61f2cc7077c329e34fe4e39ea09f9eb Mon Sep 17 00:00:00 2001 From: "Habib (ayh)" Date: Thu, 4 May 2023 07:41:14 +0000 Subject: [PATCH] [FIX] account: context issue when importing statements The file uploader uses a context key `default_journal_id` to identify the journal to upload to. With commit https://github.com/odoo/enterprise/commit/0d7d1a2994f14b80cd8f3644871f87a472821741, we attempt to reconcile imported transactions immediately. When reconciling, if there is a partner and an account number, the res.partner.bank is created. Problem: When creating a partner bank account, the default_journal_id is in the context, and is interpreted as a default value, which causes a stack trace. Solution: Explicitly specifiy the journal_id when the partner bank account is created, so there is no invalid value when obtaining defaults. task-3299109 opw-3291805 opw-3291064 opw-3291024 closes odoo/odoo#120554 X-original-commit: ff4e080d3e006104cf6345d96e56714b0f8be16d Signed-off-by: Laurent Smet Signed-off-by: Ayob Habib (ayh) --- addons/account/models/account_bank_statement_line.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/models/account_bank_statement_line.py b/addons/account/models/account_bank_statement_line.py index d3105d900a3..735c845bf39 100644 --- a/addons/account/models/account_bank_statement_line.py +++ b/addons/account/models/account_bank_statement_line.py @@ -422,6 +422,7 @@ class AccountBankStatementLine(models.Model): bank_account = self.env['res.partner.bank'].create({ 'acc_number': self.account_number, 'partner_id': self.partner_id.id, + 'journal_id': None, }) return bank_account