[IMP] website_sale : Remove deprecated hidden product attribute type on product variants
Purpose ======= Hidden mode on product attributes (variants) is deprecated Beforehand it was used to not show the attribute name in the order (in case of single attributes). Now it's automatic: if only one value for a product attribute, this value doesn't show up in the product name. see support ticket 744129 Specification ============= remove it
This commit is contained in:
committed by
Yannick Tivisse
parent
ee9b3e0d0c
commit
19b1262109
@@ -87,8 +87,6 @@ class TableCompute(object):
|
||||
|
||||
return rows
|
||||
|
||||
# TODO keep with input type hidden
|
||||
|
||||
|
||||
class WebsiteSaleForm(WebsiteForm):
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ class Product(models.Model):
|
||||
class ProductAttribute(models.Model):
|
||||
_inherit = "product.attribute"
|
||||
|
||||
type = fields.Selection([('radio', 'Radio'), ('select', 'Select'), ('color', 'Color'), ('hidden', 'Hidden')], default='radio')
|
||||
type = fields.Selection([('radio', 'Radio'), ('select', 'Select'), ('color', 'Color')], default='radio')
|
||||
|
||||
|
||||
class ProductAttributeValue(models.Model):
|
||||
|
||||
@@ -316,40 +316,41 @@
|
||||
<input type="hidden" name="search" t-att-value="search" />
|
||||
<ul class="nav nav-pills nav-stacked mt16">
|
||||
<t t-foreach="attributes" t-as="a">
|
||||
<t t-if="a.type != 'hidden'">
|
||||
<li t-if="a.value_ids and len(a.value_ids) > 1">
|
||||
<div>
|
||||
<strong t-field="a.name" />
|
||||
</div>
|
||||
<t t-if="a.type == 'select'">
|
||||
<select class="form-control" name="attrib">
|
||||
<option value="" />
|
||||
<t t-foreach="a.value_ids" t-as="v">
|
||||
<option t-att-value="'%s-%s' % (a.id,v.id)" t-esc="v.name" t-att-selected="v.id in attrib_set" />
|
||||
</t>
|
||||
</select>
|
||||
</t>
|
||||
<t t-if="a.type == 'radio'">
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<t t-foreach="a.value_ids" t-as="v">
|
||||
<li t-att-class="'active' if v.id in attrib_set else None">
|
||||
<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 None" />
|
||||
<span style="font-weight: normal" t-field="v.name" />
|
||||
</label>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
</t>
|
||||
<t t-if="a.type == 'color'">
|
||||
<li t-if="a.value_ids and len(a.value_ids) > 1">
|
||||
<div>
|
||||
<strong t-field="a.name" />
|
||||
</div>
|
||||
<t t-if="a.type == 'select'">
|
||||
<select class="form-control" name="attrib">
|
||||
<option value="" />
|
||||
<t t-foreach="a.value_ids" t-as="v">
|
||||
<label t-attf-style="background-color:#{v.html_color or v.name}" t-attf-class="css_attribute_color #{'active' 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 None" t-att-title="v.name" />
|
||||
</label>
|
||||
<option t-att-value="'%s-%s' % (a.id,v.id)" t-esc="v.name" t-att-selected="v.id in attrib_set" />
|
||||
</t>
|
||||
</select>
|
||||
</t>
|
||||
<t t-if="a.type == 'radio'">
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<t t-foreach="a.value_ids" t-as="v">
|
||||
<li t-att-class="'active' if v.id in attrib_set else None">
|
||||
<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 None" />
|
||||
<span style="font-weight: normal" t-field="v.name" />
|
||||
</label>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
</t>
|
||||
<t t-if="a.type == 'color'">
|
||||
<t t-foreach="a.value_ids" t-as="v">
|
||||
<label t-attf-style="background-color:#{v.html_color or v.name}" t-attf-class="css_attribute_color #{'active' 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 None" t-att-title="v.name" />
|
||||
</label>
|
||||
</t>
|
||||
</li>
|
||||
</t>
|
||||
</t>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
</form>
|
||||
@@ -631,7 +632,7 @@
|
||||
|
||||
<strong t-field="variant_id.attribute_id.name"/>
|
||||
|
||||
<t t-if="variant_id.attribute_id.type in ['select', 'hidden']">
|
||||
<t t-if="variant_id.attribute_id.type == 'select'">
|
||||
<select t-attf-class="form-control #{'js_variant_change' if variant_id.attribute_id.create_variant else ''}" t-att-name="'attribute-%s-%s' % (product.id, variant_id.attribute_id.id)">
|
||||
<t t-foreach="variant_id.value_ids" t-as="value_id">
|
||||
<option t-att-value="value_id.id">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<record id="product_attribute_1" model="product.attribute">
|
||||
<field name="name">Duration</field>
|
||||
<field name="type">hidden</field>
|
||||
<field name="type">select</field>
|
||||
</record>
|
||||
<record id="product_attribute_value_1" model="product.attribute.value">
|
||||
<field name="name">1 year</field>
|
||||
|
||||
Reference in New Issue
Block a user