mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]pms_api_rest: added default availability plan in property service and datamodel
This commit is contained in:
@@ -16,6 +16,7 @@ class PmsPropertyInfo(Datamodel):
|
||||
name = fields.String(required=False, allow_none=True)
|
||||
company = fields.String(required=False, allow_none=True)
|
||||
defaultPricelistId = fields.Integer(required=False, allow_none=True)
|
||||
defaultAvailabilityPlanId = fields.Integer(required=False, allow_none=True)
|
||||
colorOptionConfig = fields.String(required=False, allow_none=True)
|
||||
preReservationColor = fields.String(required=False, allow_none=True)
|
||||
confirmedReservationColor = fields.String(required=False, allow_none=True)
|
||||
|
||||
@@ -34,6 +34,7 @@ class PmsPropertyService(Component):
|
||||
name=prop.name,
|
||||
company=prop.company_id.name,
|
||||
defaultPricelistId=prop.default_pricelist_id.id,
|
||||
defaultAvailabilityPlanId=prop.default_pricelist_id.availability_plan_id.id,
|
||||
colorOptionConfig=prop.color_option_config,
|
||||
preReservationColor=prop.pre_reservation_color,
|
||||
confirmedReservationColor=prop.confirmed_reservation_color,
|
||||
@@ -65,6 +66,7 @@ class PmsPropertyService(Component):
|
||||
)
|
||||
def get_property(self, property_id):
|
||||
pms_property = self.env["pms.property"].search([("id", "=", property_id)])
|
||||
default_avail = pms_property.default_pricelist_id.availability_plan_id.id
|
||||
res = []
|
||||
PmsPropertyInfo = self.env.datamodels["pms.property.info"]
|
||||
if not pms_property:
|
||||
@@ -75,6 +77,7 @@ class PmsPropertyService(Component):
|
||||
name=pms_property.name,
|
||||
company=pms_property.company_id.name,
|
||||
defaultPricelistId=pms_property.default_pricelist_id.id,
|
||||
defaultAvailabilityPlanId=default_avail,
|
||||
colorOptionConfig=pms_property.color_option_config,
|
||||
preReservationColor=pms_property.pre_reservation_color,
|
||||
confirmedReservationColor=pms_property.confirmed_reservation_color,
|
||||
|
||||
Reference in New Issue
Block a user