diff --git a/models/res_partner.py b/models/res_partner.py index 7e9800d9a3a2b84a511518e36b6caaa3203e0796..734890db21ece47d45bc38630a45be920ea46b60 100644 --- a/models/res_partner.py +++ b/models/res_partner.py @@ -360,6 +360,14 @@ class ScopPartner(models.Model): string="Licéité du contact", compute="_compute_contact_legality", store=True) + associate = fields.Selection( + selection=[('asso',"Associé extérieur"), + ('coop',"Associé coopérateur"), + ('none',"Non associé")], + string="Associé") + employee = fields.Boolean( + string="Salarié", + default=True) # Champs pour partenaires organization_type_id = fields.Many2one( diff --git a/views/res_partner.xml b/views/res_partner.xml index 98bf053c250dc481e41d5efe6bcff895d3faead3..b0f38242a32a4823561179414999cccd1993d5a1 100644 --- a/views/res_partner.xml +++ b/views/res_partner.xml @@ -126,26 +126,24 @@ <attribute name="invisible">1</attribute> </field> <xpath expr='//form/sheet/group/group[2]' position="replace"> - <group name="contact_segment_info" attrs="{'invisible': ['|', ('is_company','=', False), ('type','!=', 'contact')]}"> - <field name="certification_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" attrs="{'invisible': [('is_company','=', False)]}"/> + <group name="partner_segment_info" attrs="{'invisible': [('is_company', '=', False)]}"> + <field name="certification_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" attrs="{'invisible': [('is_company', '=', False)]}"/> <field name="segment_1_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> <field name="segment_2_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> <field name="segment_3_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> <field name="segment_4_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> <field name="organization_subtype_id" attrs="{'invisible': [('is_company','=', False)]}" domain="[('child_ids', '=', False)]" options="{'no_create': True, 'no_open': True}"/> - <field name="organization_type_id" readonly="1" attrs="{'invisible': [('is_company','=', False)]}" options="{'no_create': True, 'no_open': True}"/> + <field name="organization_type_id" readonly="1" attrs="{'invisible': [('is_company', '=', False)]}" options="{'no_create': True, 'no_open': True}"/> </group> - <group name="partner_segment_info" attrs="{'invisible': ['|', ('is_company','=', True), ('type','!=', 'contact')]}"> + <group name="contact_segment_info" attrs="{'invisible': ['|', ('is_company', '=', True), ('type', '!=', 'contact']}"> <field name="title" options='{"no_create": True, "no_open": True}' attrs="{'invisible': [('is_company','=', True)]}"/> <field name="mandate_id" options='{"no_create": True, "no_open": True}' attrs="{'invisible': [('is_company','=', True)]}"/> <field name="function"/> + <field name="employee" attrs="{'invisible': [('is_company','=', True)]}"/> + <field name="associate" attrs="{'invisible': [('is_company','=', True)]}"/> <field name="birthyear" attrs="{'invisible': [('is_company','=', True)]}"/> <field name="contact_origin_id" attrs="{'invisible': [('is_company','=', True)]}" options="{'no_create': True, 'no_open': True}"/> <field name="contact_legality" readonly="True" attrs="{'invisible': [('is_company','=', True)]}"/> - <field name="segment_1_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> - <field name="segment_2_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> - <field name="segment_3_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> - <field name="segment_4_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> </group> </xpath> <xpath expr='//form/sheet/group' position="after"> @@ -166,8 +164,7 @@ <xpath expr="//field[@name='child_ids']//kanban//div[hasclass('oe_kanban_details')]//field[@name='name']" position="after"> <div t-if="record.mandate_id.raw_value"><field name="mandate_id"/></div> </xpath> - <xpath expr="//field[@name='child_ids']//form//field[@name='function']" position="before"> - <field name="mandate_id" options='{"no_open": True, "no_create": True}' attrs="{'invisible': [('type','!=', 'contact')]}"/> + <xpath expr="//field[@name='child_ids']//form//field[@name='function']" position="replace"> <field name="ur_id" invisible="1" options='{"no_open": True, "no_create": True}'/> </xpath> <xpath expr="//field[@name='child_ids']//form//field[@name='street']" position="attributes"> @@ -191,18 +188,23 @@ <xpath expr="//field[@name='child_ids']//form//field[@name='state_id']" position="attributes"> <attribute name="placeholder">Région</attribute> </xpath> + + <xpath expr="//field[@name='child_ids']//form//field[@name='mobile']" position="after"> + <field name="category_id" options='{"no_open": True, "no_create": True}' widget="many2many_tags" attrs="{'invisible': [('is_company','=', True)]}"/> + </xpath> + <xpath expr="//field[@name='child_ids']//form//field[@name='title']" position="attributes"> <attribute name="options">{'no_open': True, 'no_create': True}</attribute> </xpath> <xpath expr="//field[@name='child_ids']/form//group/group[2]" position="after"> <group attrs="{'invisible': [('type', '!=', 'contact')]}"> + <field name="mandate_id" options='{"no_open": True, "no_create": True}' /> + <field name="function"/> + <field name="employee" /> + <field name="associate" /> <field name="birthyear"/> <field name="contact_origin_id" options="{'no_open': True, 'no_create': True}"/> <field name="contact_legality" readonly="1"/> - <field name="segment_1_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> - <field name="segment_2_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> - <field name="segment_3_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> - <field name="segment_4_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> </group> </xpath> <xpath expr="//field[@name='child_ids']/form//group" position="after"> @@ -222,7 +224,7 @@ <field name="phone" widget="phone"/> <field name="mobile" widget="phone" attrs="{'invisible': [('is_company','=', True)]}"/> <field name="email" widget="email" on_change="1"/> - <field name="website"/> + <field name="website" attrs="{'invisible': [('is_company','=', False)]}"/> <field name="ur_id" options='{"no_open": True, "no_create": True}' on_change="1" can_create="false" can_write="false"/> <field name="category_id" options='{"no_open": True, "no_create": True}' widget="many2many_tags" attrs="{'invisible': [('is_company','=', True)]}"/> <field name="lang" invisible="1"/> @@ -392,7 +394,7 @@ </group> <notebook colspan="4"> <page name="scop_contacts" string="Contacts & Addresses"> - <label for="director_ids" string="Dirigeants"/> + <label for="director_ids" string="Dirigeants et mandataires"/> <p> <button name="add_director" type="object" class="btn-info" string="Ajouter un dirigeant"></button> </p> @@ -770,8 +772,6 @@ <field name="title" placeholder="Madame" options='{"no_open": True, "no_create": True}'/> <field name="firstname" string="Prénom" required="1"/> <field name="lastname" string="Nom de famille" required="1"/> - <field name="mandate_id" options="{'no_open': True, 'no_create': True}" required="1"/> - <field name="function" placeholder="Responsable des ventes"/> <field name="email"/> <field name="phone" widget="phone"/> <field name="mobile" widget="phone"/> @@ -779,13 +779,13 @@ <field name="comment" placeholder="Commentaires..."/> </group> <group> + <field name="mandate_id" options="{'no_open': True, 'no_create': True}" required="1"/> + <field name="function"/> + <field name="employee"/> + <field name="associate"/> <field name="birthyear"/> <field name="contact_origin_id" options="{'no_open': True, 'no_create': True}"/> <field name="contact_legality" readonly="1"/> - <field name="segment_1_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> - <field name="segment_2_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> - <field name="segment_3_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> - <field name="segment_4_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> </group> </group> <field name="subscription_ids"> @@ -812,7 +812,7 @@ <field name="name">scop.partner.contact.form.view</field> <field name="model">res.partner</field> <field name="arch" type="xml"> - <form string="Contact / Address"> + <form string="Contacts / Addresses"> <sheet> <field name="type" required="1" widget="radio" options="{'horizontal': true}"/> <field name="parent_id_onchange" invisible="1"/> @@ -848,9 +848,6 @@ <field name="name" string="Nom" attrs="{'required' : [('type', '!=', 'contact')], 'invisible' : [('type', '=', 'contact')]}"/> <field name="firstname" string="Prénom" attrs="{'required' : [('type', '=', 'contact')], 'invisible' : [('type', '!=', 'contact')]}"/> <field name="lastname" string="Nom de famille" attrs="{'required' : [('type', '=', 'contact')], 'invisible' : [('type', '!=', 'contact')]}"/> - <field name="mandate_id" options="{'no_open': True, 'no_create': True}" attrs="{'invisible': [('type','!=', 'contact')]}"/> - <field name="function" placeholder="e.g. Directeur des Ventes" - attrs="{'invisible': [('type','!=', 'contact')]}"/> <field name="email"/> <field name="phone" widget="phone"/> <field name="mobile" widget="phone"/> @@ -858,13 +855,13 @@ <field name="comment" placeholder="internal note..."/> </group> <group attrs="{'invisible': [('type', '!=', 'contact')]}"> + <field name="mandate_id" options="{'no_open': True, 'no_create': True}"/> + <field name="function"/> + <field name="employee"/> + <field name="associate"/> <field name="birthyear"/> <field name="contact_origin_id" options="{'no_open': True, 'no_create': True}"/> <field name="contact_legality" readonly="1"/> - <field name="segment_1_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> - <field name="segment_2_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> - <field name="segment_3_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> - <field name="segment_4_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> </group> </group> <field name="subscription_ids" attrs="{'invisible': [('type', '!=', 'contact')]}">