changeset 47dab02eb748 in modules/stock:default
details: https://hg.tryton.org/modules/stock?cmd=changeset;node=47dab02eb748
description:
Do not browse repeated products
If there are repeated product ids in the browse list, the loop gets too
slow.
issue8756
review274121002
diffstat:
inventory.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r 0b3269cab0c9 -r 47dab02eb748 inventory.py
--- a/inventory.py Wed Oct 16 21:27:48 2019 +0200
+++ b/inventory.py Fri Oct 25 10:08:35 2019 +0200
@@ -246,7 +246,7 @@
# Index some data
product2type = {}
product2consumable = {}
- for product in Product.browse([line[1] for line in pbl]):
+ for product in Product.browse({line[1] for line in pbl}):
product2type[product.id] = product.type
product2consumable[product.id] = product.consumable