[IMP] crm: add name on some lead view form groups to ease inheritance

Crm Lead has a quite complex form view as the same view is used for both
leads and opportunities. There are therefore some duplicated fields, such
as partner_id.

It is therefore complicated to use xpath to locate such fields. Adding a
name on groups containing those lead / opportunity specific fields make
the view easier to inherit using xpath.

closes odoo/odoo#42895

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Guewen Baconnier
2020-01-09 09:50:43 +00:00
committed by Thibault Delavallée
parent 0385745dd4
commit 0e1707004e
+4 -4
View File
@@ -107,7 +107,7 @@
</h2>
</div>
<group>
<group attrs="{'invisible': [('type', '=', 'opportunity')]}">
<group name="lead_partner" attrs="{'invisible': [('type', '=', 'opportunity')]}">
<!-- Preload all the partner's information -->
<field name="partner_id" widget="res_partner_many2one"
context="{'default_name': contact_name,
@@ -139,7 +139,7 @@
<field name="lang_id"/>
</group>
<group attrs="{'invisible': [('type', '=', 'lead')]}">
<group name="opportunity_partner" attrs="{'invisible': [('type', '=', 'lead')]}">
<field name="partner_id"
widget="res_partner_many2one"
string="Customer"
@@ -181,7 +181,7 @@
</div>
<field name="phone" widget="phone" options="{'enable_sms': True}"/>
</group>
<group attrs="{'invisible': [('type', '=', 'opportunity')]}">
<group name="lead_info" attrs="{'invisible': [('type', '=', 'opportunity')]}">
<label for="contact_name"/>
<div class="o_row">
<field name="contact_name"/>
@@ -217,7 +217,7 @@
<field name="priority" widget="priority"/>
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}"/>
</group>
<group attrs="{'invisible': [('type', '=', 'lead')]}">
<group name="opportunity_info" attrs="{'invisible': [('type', '=', 'lead')]}">
<field name="lost_reason" attrs="{'invisible': [('active', '=', True)]}"/>
<field name="date_conversion" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>