From f3daffc9396af15d44f416235b19ab39cf1b8525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Tue, 17 Dec 2024 16:38:03 +0100 Subject: [PATCH] [FIX]pms: create service touristic tax --- pms/models/pms_reservation.py | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/pms/models/pms_reservation.py b/pms/models/pms_reservation.py index 002aed799..6ae58784a 100644 --- a/pms/models/pms_reservation.py +++ b/pms/models/pms_reservation.py @@ -2630,9 +2630,21 @@ class PmsReservation(models.Model): self.env["pms.service"].create( { "reservation_id": record.id, + "folio_id": record.folio_id.id, "product_id": product.id, - "quantity": quantity, - "price_unit": price, + "name": product.name, + "service_line_ids": [ + ( + 0, + 0, + { + "product_id": product.id, + "day_qty": quantity, + "price_unit": price, + "date": record.checkin, + }, + ) + ], } ) @@ -2690,7 +2702,18 @@ class PmsReservation(models.Model): service.write( { - "quantity": quantity, - "price_unit": price, + "service_line_ids": [ + (5, 0, 0), + ( + 0, + 0, + { + "product_id": product.id, + "day_qty": quantity, + "price_unit": price, + "date": record.checkin, + }, + ), + ] } )