mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]pms-pwa: added service header for folio mails
This commit is contained in:
@@ -5,6 +5,7 @@ from odoo.addons.datamodel.core import Datamodel
|
||||
|
||||
class PmsMailInfo(Datamodel):
|
||||
_name = "pms.mail.info"
|
||||
mailType = fields.String(required=False, allow_none=True)
|
||||
subject = fields.String(required=False, allow_none=True)
|
||||
bodyMail = fields.String(required=False, allow_none=True)
|
||||
partnerIds = fields.List(fields.Integer(), required=False)
|
||||
|
||||
@@ -22,6 +22,7 @@ class PmsReservationShortInfo(Datamodel):
|
||||
isSplitted = fields.Boolean(required=False, allow_none=True)
|
||||
priceTotal = fields.Float(required=False, allow_none=True)
|
||||
servicesCount = fields.Integer(required=False, allow_none=True)
|
||||
folioSequence = fields.Integer(required=False, allow_none=True)
|
||||
|
||||
|
||||
class PmsReservationInfo(Datamodel):
|
||||
|
||||
@@ -420,6 +420,9 @@ class PmsFolioService(Component):
|
||||
allowedCheckout=reservation.allowed_checkout,
|
||||
isSplitted=reservation.splitted,
|
||||
priceTotal=round(reservation.price_room_services_set, 2),
|
||||
folioSequence=reservation.folio_sequence
|
||||
if reservation.folio_sequence
|
||||
else None,
|
||||
servicesCount=sum(
|
||||
reservation.service_ids.filtered(
|
||||
lambda x: not x.is_board_service
|
||||
@@ -679,6 +682,21 @@ class PmsFolioService(Component):
|
||||
)
|
||||
return result_services
|
||||
|
||||
@restapi.method(
|
||||
[
|
||||
(
|
||||
[
|
||||
"/<int:folio_id>/send-mail",
|
||||
],
|
||||
"POST",
|
||||
)
|
||||
],
|
||||
input_param=Datamodel("pms.mail.info"),
|
||||
auth="jwt_api_pms",
|
||||
)
|
||||
def send_folio_mail(self, folio_id, pms_mail_info):
|
||||
return True
|
||||
|
||||
@restapi.method(
|
||||
[
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user