Do not browse repeated products

If there are repeated product ids in the browse list, the loop gets too slow.

issue8756
review274121002
This commit is contained in:
Òscar Queraltó committed 2019-10-25 10:08:35 +02:00
1 parent 78bcc4cdc0
commit 127f24dc39
1 file changed
+1 -1
+1 -1
View File
@@ -246,7 +246,7 @@ class Inventory(Workflow, ModelSQL, ModelView):
# 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