changeset f47ef7a1fd17 in modules/stock:5.2
details: https://hg.tryton.org/modules/stock?cmd=changeset;node=f47ef7a1fd17
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 a2d72a5428c6 -r f47ef7a1fd17 product.py
--- a/product.py        Fri Nov 08 19:33:21 2019 +0100
+++ b/product.py        Mon Jan 20 11:08:53 2020 +0100
@@ -204,7 +204,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