Skip to content

Commit 2d70aa0

Browse files
committed
[FIX]website_sale_ux: access error on e-commerce extra fields
closes #399 Signed-off-by: Alexis Lopez <loa@adhoc.inc>
1 parent 2a7f444 commit 2d70aa0

4 files changed

Lines changed: 31 additions & 18 deletions

File tree

website_sale_ux/__manifest__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
{
2121
"name": "Website Sale UX",
2222
"category": "base.module_category_knowledge_management",
23-
"version": "18.0.2.1.0",
23+
"version": "18.0.2.2.0",
2424
"author": "ADHOC SA",
2525
"website": "www.adhoc.com.ar",
2626
"license": "AGPL-3",
@@ -34,6 +34,8 @@
3434
"views/product_template_views.xml",
3535
"views/res_config_settings_views.xml",
3636
"views/products.xml",
37+
"views/templates.xml",
38+
"views/snippets.xml",
3739
"views/ecommerce_fields.xml",
3840
"views/view_mega_menu_backend_editor.xml",
3941
],

website_sale_ux/views/products.xml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,6 @@
99
</xpath>
1010
</field>
1111
</record>
12-
<record model="ir.ui.view" id="products_item">
13-
<field name="name">website.sale.ux.products</field>
14-
<field name="inherit_id" ref="website_sale.products_item"/>
15-
<field name="arch" type="xml">
16-
<xpath expr="//div[hasclass('o_wsale_product_sub')]" position="before">
17-
<t t-if="any([product[field.name] for field in website.shop_extra_field_ids])">
18-
<p class="text-muted small">
19-
<t t-foreach="website.shop_extra_field_ids" t-as="field" t-if="product[field.name]">
20-
<t t-if="field.name == 'default_code'">
21-
<span>Ref. interna: </span><span t-esc='product[field.name]'/>
22-
</t>
23-
</t>
24-
</p>
25-
</t>
26-
</xpath>
27-
</field>
28-
</record>
2912
<record model="ir.ui.view" id="products_mobile">
3013
<field name="name">website.sale.ux.products.mobile</field>
3114
<field name="inherit_id" ref="website_sale.o_wsale_offcanvas"/>

website_sale_ux/views/snippets.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
<template id="snippet_options" inherit_id="website_sale.snippet_options">
4+
<xpath expr="//we-checkbox[@data-customize-website-views='website_sale.products_description']" position="after">
5+
<we-checkbox string="Prod. Internal. Ref."
6+
data-customize-website-views="website_sale_ux.website_internal_ref_product,website_sale_ux.website_internal_ref_products_item"
7+
data-no-preview="true"
8+
data-reload="/"/>
9+
</xpath>
10+
</template>
11+
</odoo>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
<template id="website_internal_ref_products_item" inherit_id="website_sale.products_item" name="Website Products Item Internal Ref" active="False">
4+
<xpath expr="//div[hasclass('o_wsale_product_sub')]" position="before">
5+
<p t-if="product.default_code" class="text-muted small">
6+
<span>Ref. interna: </span><span t-esc='product.default_code'/>
7+
</p>
8+
</xpath>
9+
</template>
10+
<template id="website_internal_ref_product" inherit_id="website_sale.product" name="Website Product Internal Ref" active="False">
11+
<xpath expr="//div[@id='product_details']" position="inside">
12+
<p t-if="product.default_code" class="text-muted small">
13+
<b><span>Ref. interna: </span></b><span t-esc='product.default_code'/>
14+
</p>
15+
</xpath>
16+
</template>
17+
</odoo>

0 commit comments

Comments
 (0)