[ADD]pms: product pms enabled configuration

This commit is contained in:
Darío Lodeiros
2022-11-20 10:28:39 +01:00
parent bf1495de6e
commit 66b5b286fa
4 changed files with 8 additions and 0 deletions

View File

@@ -180,6 +180,7 @@ class FolioSaleLine(models.Model):
store=True,
comodel_name="product.product",
domain="[('sale_ok', '=', True),\
('is_pms_available', '=', True),\
'|', ('company_id', '=', False), \
('company_id', '=', company_id)]",
ondelete="restrict",

View File

@@ -32,6 +32,7 @@ class PmsBoardServiceRoomTypeLine(models.Model):
comodel_name="product.product",
readonly=True,
check_pms_properties=True,
domain="[('is_pms_available', '=', True)]",
)
# TODO def default_amount "amount of service"
amount = fields.Float(

View File

@@ -26,6 +26,7 @@ class PmsService(models.Model):
comodel_name="product.product",
ondelete="restrict",
check_pms_properties=True,
domain="[(is_pms_available, '=', True)]",
)
folio_id = fields.Many2one(
string="Folio",

View File

@@ -54,6 +54,11 @@ class ProductTemplate(models.Model):
help="Indicates if that product is a crib",
default=False,
)
is_pms_available = fields.Boolean(
string="Is available in PMS",
help="Indicates if that product is available in PMS",
default=True,
)
@api.depends_context("allowed_pms_property_ids")
def _compute_daily_limit(self):