[IMP] website_sale: convert comma to dashed for url attrib
This commit is contained in:
parent
86c6cf7a68
commit
c3c922f84e
|
@ -126,7 +126,7 @@ class website_sale(http.Controller):
|
||||||
domain += [('product_variant_ids.public_categ_ids', 'child_of', int(category))]
|
domain += [('product_variant_ids.public_categ_ids', 'child_of', int(category))]
|
||||||
|
|
||||||
attrib_list = request.httprequest.args.getlist('attrib')
|
attrib_list = request.httprequest.args.getlist('attrib')
|
||||||
attrib_values = [map(int,v.split(",")) for v in attrib_list if v]
|
attrib_values = [map(int,v.split("-")) for v in attrib_list if v]
|
||||||
attrib_set = set([v[1] for v in attrib_values])
|
attrib_set = set([v[1] for v in attrib_values])
|
||||||
|
|
||||||
if attrib_values:
|
if attrib_values:
|
||||||
|
@ -201,7 +201,7 @@ class website_sale(http.Controller):
|
||||||
category = category_obj.browse(request.cr, request.uid, int(category), context=request.context)
|
category = category_obj.browse(request.cr, request.uid, int(category), context=request.context)
|
||||||
|
|
||||||
attrib_list = request.httprequest.args.getlist('attrib')
|
attrib_list = request.httprequest.args.getlist('attrib')
|
||||||
attrib_values = [map(int,v.split(",")) for v in attrib_list if v]
|
attrib_values = [map(int,v.split("-")) for v in attrib_list if v]
|
||||||
attrib_set = set([v[1] for v in attrib_values])
|
attrib_set = set([v[1] for v in attrib_values])
|
||||||
|
|
||||||
keep = QueryURL('/shop', category=category and category.id, search=search, attrib=attrib_list)
|
keep = QueryURL('/shop', category=category and category.id, search=search, attrib=attrib_list)
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
<record id="product_product_1" model="product.product">
|
<record id="product_product_1" model="product.product">
|
||||||
<field name="name">Warranty</field>
|
<field name="name">Warranty</field>
|
||||||
<field name="list_price">20.0</field>
|
<field name="list_price">20.0</field>
|
||||||
|
<field name="website_published" eval="True"/>
|
||||||
<field name="type">service</field>
|
<field name="type">service</field>
|
||||||
<field name="uom_id" ref="product.product_uom_unit"/>
|
<field name="uom_id" ref="product.product_uom_unit"/>
|
||||||
<field name="uom_po_id" ref="product.product_uom_unit"/>
|
<field name="uom_po_id" ref="product.product_uom_unit"/>
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<template id="search" name="Search hidden fields">
|
<template id="search" name="Search hidden fields">
|
||||||
<t t-if="attrib_values">
|
<t t-if="attrib_values">
|
||||||
<t t-foreach="attrib_values" t-as="a">
|
<t t-foreach="attrib_values" t-as="a">
|
||||||
<input type="hidden" name="attrib" t-att-value="'%s,%s' % (a[0], a[1])"/>
|
<input type="hidden" name="attrib" t-att-value="'%s-%s' % (a[0], a[1])"/>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
<input t-if="category" type="hidden" name="category" t-att-value="int(category or 0)"/>
|
<input t-if="category" type="hidden" name="category" t-att-value="int(category or 0)"/>
|
||||||
|
@ -280,7 +280,7 @@
|
||||||
<select class="form-control" name="attrib">
|
<select class="form-control" name="attrib">
|
||||||
<option value=""/>
|
<option value=""/>
|
||||||
<t t-foreach="a.value_ids" t-as="v">
|
<t t-foreach="a.value_ids" t-as="v">
|
||||||
<option t-att-value="'%s,%s' % (a.id,v.id)" t-field="v.name" t-att-selected="'selected' if v.id in attrib_set else ''"/>
|
<option t-att-value="'%s-%s' % (a.id,v.id)" t-field="v.name" t-att-selected="'selected' if v.id in attrib_set else ''"/>
|
||||||
</t>
|
</t>
|
||||||
</select>
|
</select>
|
||||||
</t>
|
</t>
|
||||||
|
@ -289,7 +289,7 @@
|
||||||
<t t-foreach="a.value_ids" t-as="v">
|
<t t-foreach="a.value_ids" t-as="v">
|
||||||
<li t-att-class="'active' if v.id in attrib_set else ''">
|
<li t-att-class="'active' if v.id in attrib_set else ''">
|
||||||
<label style="margin: 0 20px;">
|
<label style="margin: 0 20px;">
|
||||||
<input type="checkbox" name="attrib" t-att-value="'%s,%s' % (a.id,v.id)" t-att-checked="'checked' if v.id in attrib_set else ''"/>
|
<input type="checkbox" name="attrib" t-att-value="'%s-%s' % (a.id,v.id)" t-att-checked="'checked' if v.id in attrib_set else ''"/>
|
||||||
<span style="font-weight: normal" t-field="v.name"/>
|
<span style="font-weight: normal" t-field="v.name"/>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
|
@ -302,7 +302,7 @@
|
||||||
t-attf-class="css_attribute_color #{'active' if v.id in attrib_set else ''}">
|
t-attf-class="css_attribute_color #{'active' if v.id in attrib_set else ''}">
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
name="attrib"
|
name="attrib"
|
||||||
t-att-value="'%s,%s' % (a.id,v.id)"
|
t-att-value="'%s-%s' % (a.id,v.id)"
|
||||||
t-att-checked="'checked' if v.id in attrib_set else ''"
|
t-att-checked="'checked' if v.id in attrib_set else ''"
|
||||||
t-att-title="v.name"/>
|
t-att-title="v.name"/>
|
||||||
</label>
|
</label>
|
||||||
|
|
Loading…
Reference in New Issue