Skip to content

Commit

Permalink
[FIX] account_move_import_wizard: new way to access actions
Browse files Browse the repository at this point in the history
  • Loading branch information
oihane committed Jan 13, 2025
1 parent b56e60f commit 8b428db
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions account_move_import_wizard/models/account_move_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,16 @@ 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 "[]"),
]
)
return action


class AccountMoveImportLine(models.Model):
Expand Down

0 comments on commit 8b428db

Please sign in to comment.