diff --git a/views/res_partner.xml b/views/res_partner.xml index 6828c349cea497ae86eecfffe7e00e24f95b7af0..0254bdd9d286fb782f31a3e474181ad2913fc9ab 100644 --- a/views/res_partner.xml +++ b/views/res_partner.xml @@ -4,7 +4,7 @@ <odoo> <data> - <!-- FORM VIEW --> + <!-- FORM MAIN VIEW --> <record id="res_partner_form_inherit" model="ir.ui.view"> <field name="name">res.partner.form</field> <field name="model">res.partner</field> @@ -12,6 +12,7 @@ <field name="priority" eval="8"/> <field name="arch" type="xml"> + <!-- Header --> <xpath expr="//sheet" position="before"> <header> <field name="commerce_status_id" widget="statusbar" clickable="1" @@ -21,6 +22,7 @@ </header> </xpath> + <!-- Type of contact --> <xpath expr="//sheet/group[1]" position="before"> <group col="2"> <group> @@ -37,6 +39,7 @@ </group> </xpath> + <!-- Function and service for contact person --> <xpath expr="//field[@name='function']" position="attributes"> <attribute name="string">Fonction</attribute> <attribute name="attrs">{'invisible': [('company_type', '!=', 'person')]}</attribute> @@ -45,12 +48,39 @@ <field name="service" attrs="{'invisible': [('company_type', '!=', 'person')]}"/> </xpath> + <!-- Change place of state_id in adress --> + <xpath expr="//div[hasclass('o_address_format')]/field[@name='state_id']" position="attributes"> + <attribute name="invisible" eval="1="/> + </xpath> + <xpath expr="//div[hasclass('o_address_format')]/field[@name='country_id']" position="after"> + <field name="state_id" class="o_address_state" placeholder="Région" options="{'no_open': True, 'no_quick_create': True}" + attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}" context="{'country_id': country_id, 'default_country_id': country_id, 'zip': zip}"/> + </xpath> + + <!-- Social Websites --> <xpath expr="//field[@name='website']" position="after"> <field name="facebook" widget="url"/> <field name="twitter" widget="url"/> <field name="instagram" widget="url"/> </xpath> + <!-- Membership --> + <xpath expr="//sheet/group[2]" position="inside"> + <group attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_other)d))]}"> + <field name="is_etic_member" widget="boolean_toggle"/> + <field name="etic_membership_date" attrs="{'invisible': [('is_etic_member', '!=', True)]}"/> + </group> + </xpath> + + <!-- Contact address --> + <xpath expr="//page[@name='contact_addresses']//form//field[@name='function']" position="attributes"> + <attribute name="string">Fonction</attribute> + </xpath> + <xpath expr="//page[@name='contact_addresses']//form//field[@name='function']" position="after"> + <field name="service" attrs="{'invisible': [('type','!=', 'contact')]}"/> + </xpath> + + <!-- New pages --> <xpath expr="//page[@name='sales_purchases']" position="after"> <page name='commerce' string="Commerce" @@ -137,13 +167,6 @@ </xpath> - <xpath expr="//sheet/group[2]" position="inside"> - <group attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_other)d))]}"> - <field name="is_etic_member" widget="boolean_toggle"/> - <field name="etic_membership_date" attrs="{'invisible': [('is_etic_member', '!=', True)]}"/> - </group> - </xpath> - </field> </record> @@ -174,7 +197,6 @@ </field> </record> - <!-- SEARCH VIEW --> <record id="res_partner_search_view_inherit" model="ir.ui.view" > <field name="name">res.partner.search</field> @@ -187,5 +209,20 @@ </field> </record> + <!-- FORM SIMPLIFIED VIEW --> + <record id="res_partner_simplified_form_view_inherit" model="ir.ui.view" > + <field name="name">res.partner.simplified.form</field> + <field name="model">res.partner</field> + <field name="inherit_id" ref="base.view_partner_simple_form"/> + <field name="arch" type="xml"> + <xpath expr="//group/field[@name='function']" position="attributes"> + <attribute name="string">Fonction</attribute> + </xpath> + <xpath expr="//group/field[@name='function']" position="after"> + <field name="service" attrs="{'invisible': [('is_company','=', True)]}"/> + </xpath> + </field> + </record> + </data> </odoo>