mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] Pms_api_rest: add sales person in folio_short_info
This commit is contained in:
committed by
Darío Lodeiros
parent
5c872e2c3b
commit
04095199dc
@@ -14,8 +14,9 @@ class PmsFolioShortInfo(Datamodel):
|
|||||||
partnerName = fields.String(required=False, allow_none=True)
|
partnerName = fields.String(required=False, allow_none=True)
|
||||||
partnerPhone = fields.String(required=False, allow_none=True)
|
partnerPhone = fields.String(required=False, allow_none=True)
|
||||||
partnerEmail = fields.String(required=False, allow_none=True)
|
partnerEmail = fields.String(required=False, allow_none=True)
|
||||||
channelType = fields.String(required=False, allow_none=True)
|
saleChannel = fields.String(required=False, allow_none=True)
|
||||||
agency = fields.String(required=False, allow_none=True)
|
agency = fields.String(required=False, allow_none=True)
|
||||||
state = fields.String(required=False, allow_none=True)
|
state = fields.String(required=False, allow_none=True)
|
||||||
pendingAmount = fields.Float(required=False, allow_none=True)
|
pendingAmount = fields.Float(required=False, allow_none=True)
|
||||||
reservations = fields.List(fields.Dict(required=False, allow_none=True))
|
reservations = fields.List(fields.Dict(required=False, allow_none=True))
|
||||||
|
salesPerson = fields.String(required=False, allow_none=True)
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ class PmsFolioService(Component):
|
|||||||
else "",
|
else "",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
result_folios.append(
|
result_folios.append(
|
||||||
PmsFolioShortInfo(
|
PmsFolioShortInfo(
|
||||||
id=folio.id,
|
id=folio.id,
|
||||||
@@ -67,13 +66,14 @@ class PmsFolioService(Component):
|
|||||||
partnerName=folio.partner_name if folio.partner_name else "",
|
partnerName=folio.partner_name if folio.partner_name else "",
|
||||||
partnerPhone=folio.mobile if folio.mobile else "",
|
partnerPhone=folio.mobile if folio.mobile else "",
|
||||||
partnerEmail=folio.email if folio.email else "",
|
partnerEmail=folio.email if folio.email else "",
|
||||||
channelType=folio.channel_type_id if folio.channel_type_id else "",
|
saleChannel=folio.channel_type_id.name if folio.channel_type_id else "",
|
||||||
agency=folio.agency_id if folio.agency_id else "",
|
agency=folio.agency_id.name if folio.agency_id else "",
|
||||||
state=dict(folio.fields_get(["state"])["state"]["selection"])[
|
state=dict(folio.fields_get(["state"])["state"]["selection"])[
|
||||||
folio.state
|
folio.state
|
||||||
],
|
],
|
||||||
pendingAmount=folio.pending_amount,
|
pendingAmount=folio.pending_amount,
|
||||||
reservations=[] if not reservations else reservations,
|
reservations=[] if not reservations else reservations,
|
||||||
|
salesPerson=folio.user_id.name if folio.user_id else "",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return result_folios
|
return result_folios
|
||||||
@@ -122,10 +122,10 @@ class PmsFolioService(Component):
|
|||||||
],
|
],
|
||||||
priceTotal=reservation.price_total,
|
priceTotal=reservation.price_total,
|
||||||
adults=reservation.adults,
|
adults=reservation.adults,
|
||||||
channelTypeId=reservation.channel_type_id
|
channelTypeId=reservation.channel_type_id.name
|
||||||
if reservation.channel_type_id
|
if reservation.channel_type_id
|
||||||
else "",
|
else "",
|
||||||
agencyId=reservation.agency_id if reservation.agency_id else "",
|
agencyId=reservation.agency_id.name if reservation.agency_id else "",
|
||||||
boardServiceId=reservation.board_service_room_id.pms_board_service_id.name
|
boardServiceId=reservation.board_service_room_id.pms_board_service_id.name
|
||||||
if reservation.board_service_room_id
|
if reservation.board_service_room_id
|
||||||
else "",
|
else "",
|
||||||
|
|||||||
Reference in New Issue
Block a user