mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX] pms-pwa: fix compute priority
This commit is contained in:
committed by
Darío Lodeiros
parent
f45e8fc0e8
commit
33b0903f54
@@ -525,15 +525,16 @@ class PmsReservation(models.Model):
|
|||||||
def _compute_priority(self):
|
def _compute_priority(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
record.priority = 0
|
record.priority = 0
|
||||||
if any(
|
|
||||||
[
|
# we can give weights for each condition
|
||||||
not record.to_assign,
|
if not record.to_assign:
|
||||||
not record.left_for_checkin,
|
|
||||||
record.left_for_checkout,
|
|
||||||
record.state == "onboard" and record.folio_pending_amount > 0,
|
|
||||||
]
|
|
||||||
):
|
|
||||||
record.priority += 1
|
record.priority += 1
|
||||||
|
if not record.left_for_checkin:
|
||||||
|
record.priority += 10
|
||||||
|
if record.left_for_checkout:
|
||||||
|
record.priority += 100
|
||||||
|
if record.state == "onboard" and record.folio_pending_amount > 0:
|
||||||
|
record.priority += 1000
|
||||||
|
|
||||||
@api.depends("pricelist_id", "room_type_id")
|
@api.depends("pricelist_id", "room_type_id")
|
||||||
def _compute_board_service_room_id(self):
|
def _compute_board_service_room_id(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user