mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] pms-api-rest: add out of range folios to folio service response
This commit is contained in:
committed by
Darío Lodeiros
parent
5aeae0df74
commit
7c94f2ae86
@@ -34,8 +34,13 @@ class PmsFolioService(Component):
|
||||
)
|
||||
|
||||
if folio_search_param.date_to and folio_search_param.date_from:
|
||||
domain_fields.append(("checkin", ">=", folio_search_param.date_from))
|
||||
domain_fields.append(("checkout", "<", folio_search_param.date_to))
|
||||
reservation_lines = self.env["pms.reservation.line"].search(
|
||||
[
|
||||
("date", ">=", folio_search_param.date_from),
|
||||
("date", "<", folio_search_param.date_to),
|
||||
]
|
||||
).mapped("reservation_id").mapped("folio_id").ids
|
||||
domain_fields.append(("folio_id", "in", reservation_lines))
|
||||
|
||||
domain_filter = list()
|
||||
if folio_search_param.filter:
|
||||
@@ -149,6 +154,9 @@ class PmsFolioService(Component):
|
||||
"cancellationPolicy": reservation.pricelist_id.cancelation_rule_id.name
|
||||
if reservation.pricelist_id.cancelation_rule_id.name
|
||||
else "",
|
||||
"pendingAmount": reservation.folio_id.pending_amount,
|
||||
"toAssign": reservation.to_assign,
|
||||
"reservationType": reservation.reservation_type
|
||||
}
|
||||
)
|
||||
result_folios.append(
|
||||
|
||||
Reference in New Issue
Block a user