changeset 0cc833fbe2bf in modules/stock_supply_production:4.6 details: https://hg.tryton.org/modules/stock_supply_production?cmd=changeset;node=0cc833fbe2bf description: Catch error when removing non existant products
It should not fail when the product has been removed by get_shortage issue8354 review267421002 (grafted from e0301c4cc7654f961bcf157d39d382d8c4e8f37b) diffstat: production.py | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diffs (16 lines): diff -r 973e60e386a3 -r 0cc833fbe2bf production.py --- a/production.py Mon Apr 22 10:51:55 2019 +0200 +++ b/production.py Thu Jun 06 19:22:13 2019 +0200 @@ -197,7 +197,11 @@ 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