Skip to content

Commit

Permalink
[IMP]pms: added field to filter segmentations that are only used at c…
Browse files Browse the repository at this point in the history
…heck-in
  • Loading branch information
braisab committed Dec 26, 2023
1 parent 7a43d2c commit 1ad4f68
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pms/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PMS (Property Management System)
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f4de1bfaabc4df67eda74523262d7db3d537c6aebf1b400df5180f4a326f0fc6
!! source digest: sha256:6c5b31264d3e7504c6c81ec1ae9fc2222be30ccd7362e5d444f6d7cfe97069fa
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
1 change: 1 addition & 0 deletions pms/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"views/payment_acquirer_views.xml",
"views/account_analytic_distribution_view.xml",
"views/account_analytic_line_view.xml",
"views/res_partner_category.xml",
],
"demo": [
"demo/pms_master_data_no_update.xml",
Expand Down
1 change: 1 addition & 0 deletions pms/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@
from . import ir_pms_property
from . import payment_acquirer
from . import account_analytic_line
from . import res_partner_category
1 change: 1 addition & 0 deletions pms/models/pms_checkin_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class PmsCheckinPartner(models.Model):
help="Segmentation tags to classify checkin partners",
readonly=True,
related="reservation_id.segmentation_ids",
domain="[('is_used_in_checkin', '=', True)]",
)
checkin = fields.Date(
string="Checkin",
Expand Down
1 change: 1 addition & 0 deletions pms/models/pms_folio.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ class PmsFolio(models.Model):
help="Segmentation tags to classify folios",
comodel_name="res.partner.category",
ondelete="restrict",
domain="[('is_used_in_checkin', '=', True)]",
)
reservation_type = fields.Selection(
string="Type",
Expand Down
1 change: 1 addition & 0 deletions pms/models/pms_reservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ class PmsReservation(models.Model):
default=lambda self: self._get_default_segmentation(),
comodel_name="res.partner.category",
ondelete="restrict",
domain="[('is_used_in_checkin', '=', True)]",
)
currency_id = fields.Many2one(
string="Currency",
Expand Down
7 changes: 7 additions & 0 deletions pms/models/res_partner_category.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from odoo import fields, models


class ResPartnerCategory(models.Model):
_inherit = "res.partner.category"

is_used_in_checkin = fields.Boolean(string="Used in checkin")
2 changes: 1 addition & 1 deletion pms/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">PMS (Property Management System)</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f4de1bfaabc4df67eda74523262d7db3d537c6aebf1b400df5180f4a326f0fc6
!! source digest: sha256:6c5b31264d3e7504c6c81ec1ae9fc2222be30ccd7362e5d444f6d7cfe97069fa
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/pms/tree/14.0/pms"><img alt="OCA/pms" src="https://img.shields.io/badge/github-OCA%2Fpms-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/pms-14-0/pms-14-0-pms"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/pms&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module is an all-in-one property management system (PMS) focused on medium-sized properties
Expand Down
14 changes: 14 additions & 0 deletions pms/views/res_partner_category.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_partner_category_form_inherited" model="ir.ui.view">
<field name="name">view.partner.category.form.inherited</field>
<field name="model">res.partner.category</field>
<field name="inherit_id" ref="base.view_partner_category_form" />
<field name="arch" type="xml">
<xpath expr='//field[@name="parent_id"]' position='after'>
<field name="is_used_in_checkin" widget="boolean_toggle" />
</xpath>
</field>
</record>

</odoo>
1 change: 1 addition & 0 deletions pms/wizards/pms_booking_duplicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class BookingDuplicate(models.TransientModel):
compute="_compute_segmentation_ids",
store=True,
readonly=False,
domain="[('is_used_in_checkin', '=', True)]",
)
partner_name = fields.Char(
string="Partner name",
Expand Down
1 change: 1 addition & 0 deletions pms/wizards/pms_booking_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class BookingEngine(models.TransientModel):
help="Partner Tags",
ondelete="restrict",
comodel_name="res.partner.category",
domain="[('is_used_in_checkin', '=', True)]",
)
partner_name = fields.Char(
string="Partner name",
Expand Down

0 comments on commit 1ad4f68

Please sign in to comment.