Fix error when start_date and not value.

This commit refs #13301
This commit is contained in:
Sergio Morillo 2020-06-02 18:15:03 +02:00
parent 80d7f74888
commit cca7e04363

View file

@ -177,7 +177,7 @@ class ShipmentOut(metaclass=PoolMeta):
@classmethod
def set_end_date(cls, records, name, value):
for record in records:
if not record.start_date:
if not record.start_date or not value:
continue
_interval = value - record.start_date
record.interval = cls._format_interval(_interval)