From c246fcc5863d602b134d184ae83eb398d94636c8 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Tue, 1 Apr 2025 11:48:57 +0200 Subject: [PATCH] [IMP] account_reconcile_oca: Allow an option to avoid a function --- .../models/account_bank_statement_line.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/account_reconcile_oca/models/account_bank_statement_line.py b/account_reconcile_oca/models/account_bank_statement_line.py index e2f79238..9c5fe896 100644 --- a/account_reconcile_oca/models/account_bank_statement_line.py +++ b/account_reconcile_oca/models/account_bank_statement_line.py @@ -1266,3 +1266,11 @@ class AccountBankStatementLine(models.Model): for line in lines: self._add_account_move_line(line, keep_current=True) return res + + def _retrieve_partner(self): + if self.env.context.get("skip_retrieve_partner"): + # This hook can be used, for example, when importing files. + # With large databases, we already have the information, moreover, + # the data might be preloaded, so it has no sense to import it again + return self.partner_id + return super()._retrieve_partner()