mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX]pms_api_rest: extra beds not get service lines
This commit is contained in:
@@ -55,7 +55,10 @@ class PmsExtraBedsService(Component):
|
||||
["day_qty:sum"],
|
||||
["date:day"],
|
||||
)
|
||||
max_daily_used = max(date["day_qty"] for date in qty_for_day)
|
||||
max_daily_used = (
|
||||
max(date["day_qty"] for date in qty_for_day) if qty_for_day else 0
|
||||
)
|
||||
|
||||
avail = bed.daily_limit - max_daily_used
|
||||
# Avoid send negative values in avail
|
||||
avail = avail if avail >= 0 else 0
|
||||
|
||||
Reference in New Issue
Block a user