Catch error when removing non existant products

It should not fail when the product has been removed by get_shortage
issue8354
review267421002
This commit is contained in:
Sergi Almacellas Abellana committed 2019-06-06 19:22:13 +02:00
1 parent 757f62f826
commit 260d1f70b6
1 file changed
+5 -1
+5 -1
View File
@@ -197,7 +197,11 @@ class Production(metaclass=PoolMeta):
while (products_period
and products_period[0][0] <= (current_date - date)):
_, product = products_period.pop(0)
product_ids.remove(product.id)
try:
product_ids.remove(product.id)
except ValueError:
# product may have been already removed on get_shortages
pass
current_date += datetime.timedelta(1)
# Update current quantities with next moves