From 127f24dc3966f52d7ad6a0fe3e91c562fef1fe47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=92scar=20Queralt=C3=B3?= Date: Fri, 25 Oct 2019 10:08:35 +0200 Subject: [PATCH] Do not browse repeated products If there are repeated product ids in the browse list, the loop gets too slow. issue8756 review274121002 --- inventory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory.py b/inventory.py index 11f8e37359..a9602230e7 100644 --- a/inventory.py +++ b/inventory.py @@ -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