diff --git a/pms/models/pms_folio.py b/pms/models/pms_folio.py index ebbfaeaab3..0b9fd2c164 100644 --- a/pms/models/pms_folio.py +++ b/pms/models/pms_folio.py @@ -882,12 +882,12 @@ def _compute_company_id(self): ) def _compute_pricelist_id(self): for folio in self: - is_new = not folio.pricelist_id or not isinstance(folio.id, models.NewId) + is_new = not folio.pricelist_id or isinstance(folio.id, models.NewId) if folio.reservation_type in ("out", "staff"): folio.pricelist_id = False elif len(folio.reservation_ids.pricelist_id) == 1: folio.pricelist_id = folio.reservation_ids.pricelist_id - elif folio.agency_id and folio.agency_id.apply_pricelist and is_new: + elif is_new and folio.agency_id and folio.agency_id.apply_pricelist: folio.pricelist_id = folio.agency_id.property_product_pricelist elif ( is_new diff --git a/pms/models/pms_reservation.py b/pms/models/pms_reservation.py index 6dc1f15bd0..32bf0ca36f 100644 --- a/pms/models/pms_reservation.py +++ b/pms/models/pms_reservation.py @@ -1018,7 +1018,7 @@ def _compute_service_ids(self): @api.depends("partner_id", "agency_id") def _compute_pricelist_id(self): for reservation in self: - is_new = not reservation.pricelist_id or not isinstance( + is_new = not reservation.pricelist_id or isinstance( reservation.id, models.NewId ) if reservation.reservation_type in ("out", "staff"):