From 91a7a86c95ce077a0cbb086edd701ad4e74eeac8 Mon Sep 17 00:00:00 2001 From: DarioLodeiros Date: Sun, 24 May 2026 13:57:25 +0200 Subject: [PATCH] [IMP] pms: add active field to room.closure.reason Allow archiving room closure reasons that are no longer in use. Historical records that already reference an archived reason keep the link; the reason simply stops appearing in selection dropdowns for new closures. The form view exposes the standard "Archived" ribbon and a dedicated search view adds an "Archived" filter, wired to the menu action so it is reachable from the configuration menu. --- pms/models/pms_room_closure_reason.py | 6 ++++++ pms/views/pms_room_closure_reason_views.xml | 23 +++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/pms/models/pms_room_closure_reason.py b/pms/models/pms_room_closure_reason.py index 608f7ae792..07a5318674 100644 --- a/pms/models/pms_room_closure_reason.py +++ b/pms/models/pms_room_closure_reason.py @@ -26,3 +26,9 @@ class RoomClosureReason(models.Model): help="Explanation of the reason for closing a room", translate=True, ) + active = fields.Boolean( + default=True, + help="Uncheck to archive the room closure reason and hide it" + " from selection lists without removing the historical records" + " that already reference it.", + ) diff --git a/pms/views/pms_room_closure_reason_views.xml b/pms/views/pms_room_closure_reason_views.xml index d99f1be7d9..a59a375bf1 100644 --- a/pms/views/pms_room_closure_reason_views.xml +++ b/pms/views/pms_room_closure_reason_views.xml @@ -6,6 +6,13 @@
+ + + + pms.room.closure.reason.search + room.closure.reason + + + + + + + + Room Closure Reason room.closure.reason tree,form +