From 20f21c18daa8fe9a6cf67bdbd487b397b244cbce Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Wed, 18 Oct 2023 16:54:34 +0200 Subject: [PATCH] [IMP] oxigen_maintenance: Modify hook of maintenance_contract --- oxigen_maintenance/models/contract_contract.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oxigen_maintenance/models/contract_contract.py b/oxigen_maintenance/models/contract_contract.py index 1332e029..56cc66e2 100644 --- a/oxigen_maintenance/models/contract_contract.py +++ b/oxigen_maintenance/models/contract_contract.py @@ -30,3 +30,8 @@ def onchange_equipment_ids(self): for plan in plans: if plan.equipment_id and plan.equipment_id.id not in self.equipment_ids.ids: self.maintenance_plan_ids -= plan + + def _action_show_maintenance_requests_domain(self): + if self.maintenance_plan_ids: + return [("maintenance_plan_id", "in", self.maintenance_plan_ids.ids)] + return super()._action_show_maintenance_requests_domain()