[FIX] website_sale perfomance on public categories
Use a domain instead of python filtering when loading root categories. Closes #4324
This commit is contained in:
parent
80f2f64695
commit
c0dce6ac1e
|
@ -194,9 +194,8 @@ class website_sale(http.Controller):
|
|||
styles = style_obj.browse(cr, uid, style_ids, context=context)
|
||||
|
||||
category_obj = pool['product.public.category']
|
||||
category_ids = category_obj.search(cr, uid, [], context=context)
|
||||
categories = category_obj.browse(cr, uid, category_ids, context=context)
|
||||
categs = filter(lambda x: not x.parent_id, categories)
|
||||
category_ids = category_obj.search(cr, uid, [('parent_id', '=', False)], context=context)
|
||||
categs = category_obj.browse(cr, uid, category_ids, context=context)
|
||||
|
||||
attributes_obj = request.registry['product.attribute']
|
||||
attributes_ids = attributes_obj.search(cr, uid, [], context=context)
|
||||
|
|
Loading…
Reference in New Issue