changeset db5e2e5f8649 in modules/stock:5.4
details: https://hg.tryton.org/modules/stock?cmd=changeset;node=db5e2e5f8649
description:
        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
        (grafted from f03f5e80816ea3880a587d2056dab0d7c7b1afe5)
diffstat:

 product.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 5de65c78583f -r db5e2e5f8649 product.py
--- a/product.py        Mon Nov 04 13:11:14 2019 +0100
+++ b/product.py        Mon Jan 20 11:08:53 2020 +0100
@@ -203,7 +203,7 @@
 
         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:

Reply via email to