From 37b2710745dbaa815ab4b19641e2211f44751605 Mon Sep 17 00:00:00 2001 From: Oihane Crucelaegui Date: Mon, 13 Jan 2025 14:44:04 +0100 Subject: [PATCH] [FIX] account_move_import_wizard: new way to access actions --- .../models/account_move_import.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/account_move_import_wizard/models/account_move_import.py b/account_move_import_wizard/models/account_move_import.py index 17cf9a7a9b..d9e5263771 100644 --- a/account_move_import_wizard/models/account_move_import.py +++ b/account_move_import_wizard/models/account_move_import.py @@ -100,13 +100,17 @@ def _account_move_vals(self): def button_open_account_move(self): self.ensure_one() - action = self.env.ref("account.action_move_line_form") - action_dict = action.read()[0] if action else {} - domain = expression.AND( - [[("id", "=", self.account_move_id.id)], safe_eval(action.domain or "[]")] + action = self.env["ir.actions.actions"]._for_xml_id( + "account.action_move_line_form" ) - action_dict.update({"domain": domain}) - return action_dict + action["domain"] = expression.AND( + [ + [("id", "=", self.account_move_id.id)], + safe_eval(action.get("domain") or "[]"), + ] + ) + action["context"] = dict(self._context, create=False) + return action class AccountMoveImportLine(models.Model):