[FIX] website_sale: keep attributes filter in pager
While having a product list with 20+ products, If more than two attributes were set in the shop filter, going to the next page kept only the first filter. opw-629188
This commit is contained in:
parent
71e4d7145b
commit
c3f4ec856c
|
@ -152,7 +152,6 @@ class website_sale(http.Controller):
|
|||
('description_sale', 'ilike', srch), ('product_variant_ids.default_code', 'ilike', srch)]
|
||||
if category:
|
||||
domain += [('public_categ_ids', 'child_of', int(category))]
|
||||
|
||||
attrib_list = request.httprequest.args.getlist('attrib')
|
||||
attrib_values = [map(int,v.split("-")) for v in attrib_list if v]
|
||||
attrib_set = set([v[1] for v in attrib_values])
|
||||
|
@ -190,6 +189,8 @@ class website_sale(http.Controller):
|
|||
if category:
|
||||
category = pool['product.public.category'].browse(cr, uid, int(category), context=context)
|
||||
url = "/shop/category/%s" % slug(category)
|
||||
if attrib_list:
|
||||
post['attrib'] = attrib_list
|
||||
pager = request.website.pager(url=url, total=product_count, page=page, step=PPG, scope=7, url_args=post)
|
||||
product_ids = product_obj.search(cr, uid, domain, limit=PPG, offset=pager['offset'], order='website_published desc, website_sequence desc', context=context)
|
||||
products = product_obj.browse(cr, uid, product_ids, context=context)
|
||||
|
|
Loading…
Reference in New Issue