Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

Commit ae8e9bb

Browse files
committed
[FIX]change attribute name
1 parent 46cda27 commit ae8e9bb

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

website_product_configurator/data/config_form_templates.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@
278278
<t t-foreach="cfg_step_attribute_line_ids" t-as="line">
279279
<t t-set="custom_value" t-value="custom_value_ids.filtered(lambda x, line=line: x.attribute_id == line.attribute_id)"/>
280280
<t t-set="available_val" t-value="any(val in available_value_ids for val in (line.value_ids.ids + (line.custom and [custom_val_id.id] or [])))"/>
281-
<div t-att-class="'attribute_container' + ((not available_val and line.invisible) and ' d-none' or '')">
281+
<div t-att-class="'attribute_container' + ((not available_val and line.hide) and ' d-none' or '')">
282282
<label class="control-label" t-esc="line.attribute_id.name" t-att-data-oe-id="line.attribute_id.id"></label>
283283
<select t-att-id="'%s%s' % (field_prefix, line.attribute_id.id)"
284284
t-att-data-oe-id="line.attribute_id.id"
@@ -287,7 +287,7 @@
287287
t-att-name="'%s%s' % (field_prefix, line.attribute_id.id)"
288288
t-att-class="'form-control config_attribute' + (' required_config_attrib' if (not available_val and line.required and line.custom) or (available_val and line.required) else '') + (' d-none' if not line.value_ids else '')"
289289
t-att-data-old-val-id="(value_ids &amp; line.value_ids) and (value_ids &amp; line.value_ids).ids[0] or ''"
290-
t-att-data-attr-invisible="line.invisible">
290+
t-att-data-attr-hide="line.hide">
291291

292292
<!-- t-att-disabled="'disabled' if not available_val_ids and not line.custom else None" -->
293293
<option name=""/>
@@ -339,7 +339,7 @@
339339
<t t-foreach="cfg_step_attribute_line_ids" t-as="line">
340340
<t t-set="custom_value" t-value="custom_value_ids.filtered(lambda x, line=line: x.attribute_id == line.attribute_id)"/>
341341
<t t-set="available_val" t-value="any(val in available_value_ids for val in (line.value_ids.ids + (line.custom and [custom_val_id.id] or [])))"/>
342-
<div t-att-class="'attribute_container' + ((not available_val and line.invisible) and ' d-none' or '')">
342+
<div t-att-class="'attribute_container' + ((not available_val and line.hide) and ' d-none' or '')">
343343
<label class="control-label" t-esc="line.attribute_id.name" t-att-data-oe-id="line.attribute_id.id"></label>
344344
<fieldset t-att-id="'%s%s' % (field_prefix, line.attribute_id.id)"
345345
t-att-data-oe-id="line.attribute_id.id"
@@ -348,7 +348,7 @@
348348
t-att-class="'form-control config_attribute' + (' required_config_attrib' if (not available_val and line.required and line.custom) or (available_val and line.required) else '') + (' d-none' if not line.value_ids else '')"
349349
style="height: unset;"
350350
t-att-data-old-val-id="(value_ids &amp; line.value_ids) and (value_ids &amp; line.value_ids).ids[0] or ''"
351-
t-att-data-attr-invisible="line.invisible">
351+
t-att-data-attr-hide="line.hide">
352352
<t t-foreach="line.value_ids" t-as="value">
353353
<div class="radio-card-container">
354354
<div class="info_config_attr_value_radio">

website_product_configurator/models/product_attribute.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class ProductAttribute(models.Model):
55
_inherit = 'product.attribute'
66

7-
invisible = fields.Boolean(
7+
hide = fields.Boolean(
88
string="Invisible",
99
help="Set in order to make attribute invisible, "
1010
"when there is no available attribute values, in the configuration "
@@ -15,7 +15,7 @@ class ProductAttribute(models.Model):
1515
class ProductAttributeLine(models.Model):
1616
_inherit = "product.template.attribute.line"
1717

18-
invisible = fields.Boolean(
18+
hide = fields.Boolean(
1919
string="Invisible",
2020
help="Set in order to make attribute invisible, "
2121
"when there is no available attribute values, in the configuration "
@@ -25,5 +25,5 @@ class ProductAttributeLine(models.Model):
2525
@api.onchange("attribute_id")
2626
def onchange_attribute(self):
2727
res = super(ProductAttributeLine, self).onchange_attribute()
28-
self.invisible = self.attribute_id.invisible
28+
self.hide = self.attribute_id.hide
2929
return res

website_product_configurator/static/src/js/config_form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ odoo.define('website_product_configurator.config_form', function (require) {
183183
}
184184

185185
var attr_box = $selection.closest('.attribute_container');
186-
if (!domain[0][2].length && $selection.attr('data-attr-invisible') && !attr_box.hasClass('d-none')) {
186+
if (!domain[0][2].length && $selection.attr('data-attr-hide') && !attr_box.hasClass('d-none')) {
187187
attr_box.addClass('d-none');
188188
$selection.removeClass('textbox-border-color');
189189
} else if (domain[0][2].length && attr_box.hasClass('d-none')) {

website_product_configurator/views/product_attribute_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<field name="inherit_id" ref="product_configurator.product_attribute_form_view"/>
88
<field name="arch" type="xml">
99
<xpath expr="//field[@name='required']" position="before">
10-
<field name="invisible"/>
10+
<field name="hide"/>
1111
</xpath>
1212
</field>
1313
</record>

website_product_configurator/views/product_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<field name="website_tmpl_id"/>
1212
</xpath>
1313
<xpath expr="//field[@name='attribute_line_ids']//tree//field[@name='required']" position="before">
14-
<field name="invisible" invisible="not context.get('default_config_ok', False)"/>
14+
<field name="hide" invisible="not context.get('default_config_ok', False)"/>
1515
</xpath>
1616
</field>
1717
</record>

0 commit comments

Comments
 (0)