Skip to content

Commit

Permalink
[IMP] Change date format in checkin and checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
saralb9 committed Sep 3, 2021
1 parent 70720b0 commit abe62b8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pms_api_rest/services/folio_services.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from odoo.addons.base_rest import restapi
from odoo.addons.base_rest_datamodel.restapi import Datamodel
from odoo.addons.component.core import Component
from datetime import datetime


class PmsFolioService(Component):
Expand Down Expand Up @@ -32,8 +33,8 @@ def get_folios(self, folio_search_param):
PmsFolioShortInfo = self.env.datamodels["pms.folio.short.info"]
for folio in (
self.env["pms.folio"]
.sudo()
.search(
.sudo()
.search(
domain,
)
):
Expand All @@ -42,8 +43,8 @@ def get_folios(self, folio_search_param):
reservations.append(
{
"id": reservation.id,
"checkin": str(reservation.checkin),
"checkout": str(reservation.checkout),
"checkin": datetime.combine(reservation.checkin, datetime.min.time()).isoformat(),
"checkout": datetime.combine(reservation.checkout, datetime.min.time()).isoformat(),
"preferredRoomId": reservation.preferred_room_id.name
if reservation.preferred_room_id
else "",
Expand All @@ -53,6 +54,9 @@ def get_folios(self, folio_search_param):
"priceTotal": reservation.price_total,
"adults": reservation.adults,
"pricelist": reservation.pricelist_id.name,
"boardService": reservation.board_service_room_id.pms_board_service_id.name
if reservation.board_service_room_id
else "",
}
)

Expand Down

0 comments on commit abe62b8

Please sign in to comment.