From 3242d3258ca1db48bfd7b1564170fb5a3ff55257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 20 Jan 2020 11:08:53 +0100 Subject: [PATCH] Iterate over a copy of keys in products_by_location As the quantities dictionary may change during the iteration, we must loop over a copy of the keys. issue8978 review260771002 --- product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product.py b/product.py index e1312fc270..1d1d448c17 100644 --- a/product.py +++ b/product.py @@ -203,7 +203,7 @@ class Product(StockMixin, object, metaclass=PoolMeta): if wh_to_add: for wh, storage in wh_to_add.items(): - for key in quantities: + for key in list(quantities.keys()): if key[0] == storage: quantities[(wh,) + key[1:]] = quantities[key] if storage in storage_to_remove: