diff --git a/production.py b/production.py index 4994d49cfb..87dcf374d0 100644 --- a/production.py +++ b/production.py @@ -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