summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorSébastien Theys <seb@odoo.com>2019-08-13 15:43:49 +0000
committerSébastien Theys <seb@odoo.com>2019-08-13 16:55:45 +0000
commit08f3f3dffb7d0d9cfe422e2bf114f1bbafa99cb0 (patch)
treeccfea4f140e5bea0aa01d8a5ed9ccc0da2aaa4e4 /addons
parent1856b895cb401d530cbc4e3ad8db725db538663d (diff)
[IMP] website_sale: speed up loading of attributes on shop
For 10000 templates, of which around 1000 have variants, with 100 existing attributes and 20 values for each: - Displaying the /shop page takes 0.55s before the commit and 0.49s after. That's a 60ms again, around 10% faster. - The number of queries goes from 113 to 106. - The specific line that is changed goes from 6.3% total request time down to 2.77%, so the line becomes 2.3 times faster. closes odoo/odoo#34213 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/website_sale/controllers/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py
index f6f6803760c..ba6f5548504 100644
--- a/addons/website_sale/controllers/main.py
+++ b/addons/website_sale/controllers/main.py
@@ -278,7 +278,7 @@ class WebsiteSale(http.Controller):
ProductAttribute = request.env['product.attribute']
if products:
# get all products without limit
- attributes = ProductAttribute.search([('attribute_line_ids.value_ids', '!=', False), ('attribute_line_ids.product_tmpl_id', 'in', search_product.ids)])
+ attributes = ProductAttribute.search([('product_tmpl_ids', 'in', search_product.ids)])
else:
attributes = ProductAttribute.browse(attributes_ids)