summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornje-odoo <nje@odoo.com>2019-12-04 05:54:38 +0000
committernje-odoo <nje@odoo.com>2019-12-10 06:35:05 +0000
commit2850820ce49f1339568edf47fbe3207368689110 (patch)
tree6bfbbbffdbe1677c42492d037d5090c3a850a0fe
parent16cd396d03d0d27b165d9baff46991f26ba5bddb (diff)
[FIX] product,(_email_template),sale: fill the blank hole for empty group
before this commit when we installed website_sale and event_sale module. it will display blank hole before Events group because 'email_template_and_project' group is define in product/product_views.xml as invisible. So fix this issue by moving this group into product_template_email/product_view.xml and also rename the group as email_template because this group is not related with project. Also keep sale group empty in 'sales' page so other views updated to make compatible with new group changes. To keep groups in ordered, set the priority in view. task-2150643 closes: #41308
-rw-r--r--addons/event_sale/views/product_views.xml2
-rw-r--r--addons/product/views/product_views.xml1
-rw-r--r--addons/product_email_template/views/product_views.xml24
-rw-r--r--addons/sale/views/sale_views.xml3
-rw-r--r--addons/website_sale/views/product_views.xml3
5 files changed, 14 insertions, 19 deletions
diff --git a/addons/event_sale/views/product_views.xml b/addons/event_sale/views/product_views.xml
index 52d43f67b6d..bae39fba451 100644
--- a/addons/event_sale/views/product_views.xml
+++ b/addons/event_sale/views/product_views.xml
@@ -5,7 +5,7 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="arch" type="xml">
- <group name="email_template_and_project" position="after">
+ <group name="sale" position="inside">
<group string="Events">
<field name="event_ok" />
</group>
diff --git a/addons/product/views/product_views.xml b/addons/product/views/product_views.xml
index c7e2b19e187..b197d6c0f0a 100644
--- a/addons/product/views/product_views.xml
+++ b/addons/product/views/product_views.xml
@@ -82,7 +82,6 @@
</page>
<page string="Sales" attrs="{'invisible':[('sale_ok','=',False)]}" name="sales" invisible="1">
<group name="sale">
- <group name="email_template_and_project" invisible="1"/>
</group>
<group string="Sales Description" name="description">
<field name="description_sale" nolabel="1" placeholder="This note is added to sales orders and invoices."/>
diff --git a/addons/product_email_template/views/product_views.xml b/addons/product_email_template/views/product_views.xml
index 9afb300f64f..630cb659009 100644
--- a/addons/product_email_template/views/product_views.xml
+++ b/addons/product_email_template/views/product_views.xml
@@ -5,19 +5,17 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
- <xpath expr="//group[@name='email_template_and_project']" position="attributes">
- <attribute name="string">Automatic Email at Invoice</attribute>
- <attribute name="invisible">0</attribute>
- </xpath>
- <xpath expr="//group[@name='email_template_and_project']" position="inside">
- <field name="email_template_id" string="Email Template" help="Send a product-specific email once the invoice is validated"
- domain="[('model','=','product.template')]"
- context="{
- 'form_view_ref':'product_email_template.email_template_form_simplified',
- 'default_model': 'product.template',
- 'default_subject': name,
- 'default_name': name,
- }"/>
+ <xpath expr="//page[@name='sales']//group[@name='sale']" position="inside">
+ <group name="email_template" string="Automatic Email at Invoice">
+ <field name="email_template_id" string="Email Template" help="Send a product-specific email once the invoice is validated"
+ domain="[('model','=','product.template')]"
+ context="{
+ 'form_view_ref':'product_email_template.email_template_form_simplified',
+ 'default_model': 'product.template',
+ 'default_subject': name,
+ 'default_name': name,
+ }"/>
+ </group>
</xpath>
</field>
</record>
diff --git a/addons/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml
index efbecf749e6..cf8d5e42234 100644
--- a/addons/sale/views/sale_views.xml
+++ b/addons/sale/views/sale_views.xml
@@ -1115,9 +1115,10 @@
<record model="ir.ui.view" id="product_template_form_view_invoice_policy">
<field name="name">product.template.invoice.policy</field>
<field name="model">product.template</field>
+ <field name="priority">15</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
- <xpath expr="//group[@name='email_template_and_project']" position="before">
+ <xpath expr="//page[@name='sales']//group[@name='sale']" position="inside">
<group string="Invoicing" name="invoicing" invisible="1">
<field name="invoice_policy" widget="radio"/>
<field name="service_type" widget="radio" invisible="True"/>
diff --git a/addons/website_sale/views/product_views.xml b/addons/website_sale/views/product_views.xml
index 6f2d69eaff1..11cb30a8e5f 100644
--- a/addons/website_sale/views/product_views.xml
+++ b/addons/website_sale/views/product_views.xml
@@ -81,9 +81,6 @@
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<!-- add state field in header -->
- <xpath expr="//group[@name='email_template_and_project']" position="attributes">
- <attribute name="invisible">0</attribute>
- </xpath>
<xpath expr="//group[@name='description']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>