From a74784b7b6d7576122931cdf2adfc6cd9fdebd4e Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Tue, 3 Oct 2023 17:23:26 +0200 Subject: [PATCH] [FIX] maintenance_request_repair: Use the proper way to load an action --- maintenance_request_repair/models/repair_order.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/maintenance_request_repair/models/repair_order.py b/maintenance_request_repair/models/repair_order.py index b954d85ab..6902ad2e0 100644 --- a/maintenance_request_repair/models/repair_order.py +++ b/maintenance_request_repair/models/repair_order.py @@ -26,8 +26,9 @@ def action_view_maintenance_request(self): of given repair order ids. When only one found, show the maintenance request immediately. """ - action = self.env.ref("maintenance.hr_equipment_request_action") - result = action.read()[0] + result = self.env["ir.actions.act_window"]._for_xml_id( + "maintenance.hr_equipment_request_action" + ) # override the context to get rid of the default filtering on repair order result["context"] = {"default_repair_order_id": self.id} maintenance_request_ids = self.mapped("maintenance_request_ids")