mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] stock_warehouse_calendar: robustness
when delta argument is a float `plan_days` method can return unexpected False result. This can lead to silent errors. Therefore we ensure that delta is a integer in the helper.
This commit is contained in:
committed by
Thierry Ducrest
parent
f7e0d619aa
commit
a4e5e063cc
@@ -22,6 +22,8 @@ class StockWarehouse(models.Model):
|
||||
:return: datetime: resulting date.
|
||||
"""
|
||||
self.ensure_one()
|
||||
if isinstance(delta, float):
|
||||
delta = round(delta)
|
||||
if not isinstance(date_from, datetime):
|
||||
date_from = fields.Datetime.to_datetime(date_from)
|
||||
if delta == 0:
|
||||
|
||||
Reference in New Issue
Block a user