Skip to content

Commit

Permalink
[FIX]pms: fix search property parent_id partner model related
Browse files Browse the repository at this point in the history
  • Loading branch information
DarioLodeiros committed Oct 23, 2023
1 parent 302c0cf commit 6022f20
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pms/models/pms_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ class PmsProperty(models.Model):
index=True,
ondelete="restrict",
)
parent_id = fields.Many2one(
comodel_name="pms.property", string="Parent Property", index=True
)
child_ids = fields.One2many(
comodel_name="pms.property", inverse_name="parent_id", string="Child Properties"
)
pms_property_code = fields.Char(
string="Property Code",
help="Short name property",
Expand Down
1 change: 1 addition & 0 deletions pms/views/pms_folio_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@
string="Property"
enable_counters="1"
icon="fa-h-square"
domain="[('company_id', '=', company_id)]"
/>
<field
name="state"
Expand Down
1 change: 1 addition & 0 deletions pms/views/pms_reservation_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,7 @@
string="Property"
enable_counters="1"
icon="fa-h-square"
domain="[('company_id', '=', company_id])]"
/>
<field
name="state"
Expand Down
7 changes: 7 additions & 0 deletions pms/views/pms_room_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,18 @@
<field name="room_amenity_ids" />
<newline />
<searchpanel>
<field
name="company_id"
string="Company"
enable_counters="1"
icon="fa-building"
/>
<field
name="pms_property_id"
string="Property"
enable_counters="1"
select="multi"
domain="[('company_id', '=', company_id)]"
/>
<field
name="room_type_id"
Expand Down

0 comments on commit 6022f20

Please sign in to comment.