mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[add] update service line day_qty by service qty
This commit is contained in:
@@ -313,13 +313,14 @@ class PmsService(models.Model):
|
||||
"reservation_id.reservation_line_ids",
|
||||
"product_id",
|
||||
"reservation_id.adults",
|
||||
"product_qty",
|
||||
)
|
||||
def _compute_service_line_ids(self):
|
||||
for service in self:
|
||||
if service.no_auto_add_lines:
|
||||
continue
|
||||
if service.product_id:
|
||||
day_qty = 1
|
||||
day_qty = service.product_qty or 1
|
||||
if service.reservation_id and service.product_id:
|
||||
reservation = service.reservation_id
|
||||
# REVIEW: review method dependencies, reservation_line_ids
|
||||
@@ -402,6 +403,10 @@ class PmsService(models.Model):
|
||||
},
|
||||
)
|
||||
]
|
||||
# if service lines has only one line, set its day_qty to service product_qty
|
||||
elif len(service.service_line_ids) == 1 and self.product_qty:
|
||||
service.service_line_ids.day_qty = self.product_qty
|
||||
|
||||
else:
|
||||
if not service.service_line_ids:
|
||||
price_unit = service._get_price_unit_line()
|
||||
|
||||
Reference in New Issue
Block a user