Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pms/models/pms_room_closure_reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
)
23 changes: 23 additions & 0 deletions pms/views/pms_room_closure_reason_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
<field name="arch" type="xml">
<form string="Room Closure Reason">
<sheet>
<widget
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
/>
<field name="active" invisible="1" />
<field name="name" />
<field name="description" />
<field
Expand All @@ -27,10 +34,26 @@
</tree>
</field>
</record>
<record model="ir.ui.view" id="pms_room_closure_reason_view_search">
<field name="name">pms.room.closure.reason.search</field>
<field name="model">room.closure.reason</field>
<field name="arch" type="xml">
<search string="Room Closure Reason">
<field name="name" />
<field name="description" />
<filter
name="inactive"
string="Archived"
domain="[('active', '=', False)]"
/>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="open_pms_room_closure_reason_form_tree">
<field name="name">Room Closure Reason</field>
<field name="res_model">room.closure.reason</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="pms_room_closure_reason_view_search" />
</record>
<menuitem
name="Closure Reasons"
Expand Down
Loading