Skip to content

Commit d9477f5

Browse files
committed
[MIG] website_product_attribute_link: Migration to 18.0
closes #385 Signed-off-by: augusto-weiss <awe@adhoc.com.ar>
1 parent f69031c commit d9477f5

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

website_product_attribute_link/__manifest__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
##############################################################################
2020
{
2121
"name": "Product Attribute Link on Website Product view",
22-
"version": "16.0.1.0.0",
22+
"version": "18.0.1.0.0",
2323
"category": "Product",
2424
"sequence": 14,
2525
"summary": "",
@@ -28,13 +28,13 @@
2828
"license": "AGPL-3",
2929
"images": [],
3030
"depends": [
31-
"website_sale",
31+
"website_sale_comparison",
3232
],
3333
"data": [
3434
"views/product_attribute_views.xml",
3535
"views/product_attributes_templates.xml",
3636
"security/product_group_security.xml",
3737
],
38-
"installable": False,
38+
"installable": True,
3939
"application": False,
4040
}

website_product_attribute_link/models/product_attribute.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class ProductAttribute(models.Model):
1313
_inherit = "product.attribute"
1414

1515
website_link_on_product = fields.Boolean(
16+
"Website Link on Product",
1617
default=True,
1718
help="Add a link on website product view so that user can click on an "
1819
"attribute value and go to a search of products of that value",

website_product_attribute_link/views/product_attribute_views.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<odoo>
33
<record id="attribute_tree_view" model="ir.ui.view">
4-
<field name="name">product.attribute.tree.type</field>
4+
<field name="name">product.attribute.list.type</field>
55
<field name="model">product.attribute</field>
66
<field name="inherit_id" ref="product.attribute_tree_view"></field>
77
<field name="arch" type="xml">
8-
<tree>
8+
<list>
99
<field name="website_link_on_product" widget="boolean_toggle"/>
10-
</tree>
10+
</list>
1111
</field>
1212
</record>
1313

@@ -16,8 +16,10 @@
1616
<field name="model">product.attribute</field>
1717
<field name="inherit_id" ref="product.product_attribute_view_form"></field>
1818
<field name="arch" type="xml">
19-
<group>
20-
<field name="website_link_on_product" widget="boolean_toggle"/>
19+
<group name="main_fields" position="after">
20+
<group>
21+
<field name="website_link_on_product" widget="boolean_toggle"/>
22+
</group>
2123
</group>
2224
</field>
2325
</record>
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<odoo>
3-
<template id="product" inherit_id="website_sale.product" name="Product attributes Link">
4-
<span t-field="ptal.product_template_value_ids._only_active().name" position="replace">
5-
<a t-if="attribute.website_link_on_product" t-att-href="keep('/shop/', attrib=['%s-%s' % (attribute.id, ptal.product_template_value_ids._only_active().product_attribute_value_id.id)], search='', category=0)">
6-
<t>$0</t>
3+
<template id="product" inherit_id="website_sale_comparison.specifications_table" name="Product attributes Link">
4+
<xpath expr="//span[@t-field='pav.name']" position="replace">
5+
<a t-if="ptal.attribute_id.website_link_on_product"
6+
t-att-href="keep('/shop/', attribute_value=['%s-%s' % (ptal.attribute_id.id, pav.id)], search='', category=0)">
7+
<t t-esc="pav.name"/>
78
</a>
8-
<t t-if="not attribute.website_link_on_product">$0</t>
9-
</span>
9+
<t t-if="not ptal.attribute_id.website_link_on_product">
10+
<t t-esc="pav.name"/>
11+
</t>
12+
</xpath>
1013
</template>
1114
</odoo>

0 commit comments

Comments
 (0)