mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[ADD]pms: pricelist pms enabled configuration
This commit is contained in:
@@ -33,6 +33,7 @@ class BookingDuplicate(models.TransientModel):
|
||||
comodel_name="product.pricelist",
|
||||
compute="_compute_pricelist_id",
|
||||
check_pms_properties=True,
|
||||
domain="[('is_pms_available', '=', True)]",
|
||||
)
|
||||
pms_property_id = fields.Many2one(
|
||||
related="reference_folio_id.pms_property_id",
|
||||
@@ -454,6 +455,7 @@ class PmsReservationDuplicate(models.TransientModel):
|
||||
help="Pricelist used for this reservation",
|
||||
comodel_name="product.pricelist",
|
||||
check_pms_properties=True,
|
||||
domain="[('is_pms_available', '=', True)]",
|
||||
)
|
||||
price_total = fields.Float(
|
||||
string="Total price",
|
||||
|
||||
@@ -26,6 +26,7 @@ class BookingEngine(models.TransientModel):
|
||||
comodel_name="product.pricelist",
|
||||
compute="_compute_pricelist_id",
|
||||
check_pms_properties=True,
|
||||
domain="[('is_pms_available', '=', True)]",
|
||||
)
|
||||
pms_property_id = fields.Many2one(
|
||||
string="Property",
|
||||
@@ -132,7 +133,11 @@ class BookingEngine(models.TransientModel):
|
||||
@api.depends("partner_id")
|
||||
def _compute_pricelist_id(self):
|
||||
for record in self:
|
||||
record.pricelist_id = record.partner_id.property_product_pricelist.id
|
||||
record.pricelist_id = (
|
||||
record.partner_id.property_product_pricelist.id
|
||||
if record.partner_id.property_product_pricelist.is_pms_available
|
||||
else self.pms_property_id.default_pricelist_id.id
|
||||
)
|
||||
|
||||
@api.depends("agency_id")
|
||||
def _compute_channel_type_id(self):
|
||||
|
||||
@@ -140,6 +140,7 @@ class WizardFolioChanges(models.TransientModel):
|
||||
new_pricelist_id = fields.Many2one(
|
||||
string="Pricelist",
|
||||
comodel_name="product.pricelist",
|
||||
domain="[('is_pms_available', '=', True)]",
|
||||
)
|
||||
|
||||
apply_board_service = fields.Boolean(
|
||||
|
||||
@@ -280,6 +280,7 @@ class AvailabilityWizard(models.TransientModel):
|
||||
for record in self:
|
||||
record.allowed_pricelist_ids = self.env["product.pricelist"].search(
|
||||
[
|
||||
("is_pms_available", "=", True),
|
||||
("pricelist_type", "=", "daily"),
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user