[FIX] base: remove duplicated mandatory field name

When trying to save a new res.partner without name, an error appeared saying
Invalid fields:
- Name
- Name

Add condition to the domain to make it required only when displayed

Fixes #77976

closes odoo/odoo#79727

X-original-commit: f65e3d9d21d269058dd842a4319b5b2242df103e
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
Aktiv Software
2021-11-13 07:15:46 +00:00
committed by Martin Trigaux
parent d3e7bd1904
commit 8143a641a2
+2 -2
View File
@@ -88,8 +88,8 @@
<div class="oe_title">
<field name="company_type" options="{'horizontal': true}" widget="radio" groups="base.group_no_one"/>
<h1>
<field id="company" name="name" default_focus="1" placeholder="e.g. Lumber Inc" attrs="{'required' : [('type', '=', 'contact')], 'invisible': [('is_company','=', False)]}"/>
<field id="individual" name="name" default_focus="1" placeholder="e.g. Brandom Freeman" attrs="{'required' : [('type', '=', 'contact')], 'invisible': [('is_company','=', True)]}"/>
<field id="company" name="name" default_focus="1" placeholder="e.g. Lumber Inc" attrs="{'required' : [('type', '=', 'contact'),('is_company','=', True)], 'invisible': [('is_company','=', False)]}"/>
<field id="individual" name="name" default_focus="1" placeholder="e.g. Brandom Freeman" attrs="{'required' : [('type', '=', 'contact'),('is_company','=', False)], 'invisible': [('is_company','=', True)]}"/>
</h1>
<field name="parent_id"
widget="res_partner_many2one"