mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX] pms-api-rest: remove taxes percentage @ product service & reload services when board service chagned
This commit is contained in:
committed by
Darío Lodeiros
parent
3baa86ed8f
commit
f7319d99a9
@@ -16,4 +16,3 @@ class PmProductInfo(Datamodel):
|
||||
perDay = fields.Boolean(required=False, allow_none=True)
|
||||
perPerson = fields.Boolean(required=False, allow_none=True)
|
||||
consumedOn = fields.String(required=False, allow_none=True)
|
||||
taxesPercentage = fields.Float(required=False, allow_none=True)
|
||||
|
||||
@@ -53,7 +53,6 @@ class PmsProductService(Component):
|
||||
perDay=product.per_day,
|
||||
perPerson=product.per_person,
|
||||
consumedOn=product.consumed_on,
|
||||
taxesPercentage=product.taxes_id.amount if product.taxes_id.amount_type == 'percent' else None,
|
||||
)
|
||||
)
|
||||
return result_products
|
||||
|
||||
@@ -206,7 +206,8 @@ class PmsReservationService(Component):
|
||||
reservation_vals = self._create_vals_from_params(
|
||||
reservation_vals, reservation_data
|
||||
)
|
||||
if reservation_data.boardServiceId == 0:
|
||||
# TODO: this should be @ pms core
|
||||
if reservation_data.boardServiceId != reservation.board_service_room_id:
|
||||
reservation.service_ids.filtered(lambda x: x.is_board_service).unlink()
|
||||
if reservation_vals:
|
||||
reservation.write(reservation_vals)
|
||||
|
||||
Reference in New Issue
Block a user