You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
3.2 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- Copyright 2015 Tecnativa - Jairo Llopis
  3. Copyright 2017 Tecnativa - Pedro M. Baeza
  4. License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
  5. <odoo>
  6. <record id="partner_simple_form" model="ir.ui.view">
  7. <field name="model">res.partner</field>
  8. <field name="inherit_id" ref="partner_firstname.view_partner_simple_form_firstname"/>
  9. <field name="arch" type="xml">
  10. <field name="firstname" position="attributes">
  11. <attribute name="attrs">{'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
  12. </field>
  13. <field name="lastname" position="attributes">
  14. <attribute name="attrs">{'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
  15. </field>
  16. <field name="lastname" position="after">
  17. <field name="lastname2" attrs="{'required': [('firstname', '=', False), ('lastname', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}"/>
  18. </field>
  19. </field>
  20. </record>
  21. <record id="partner_form" model="ir.ui.view">
  22. <field name="model">res.partner</field>
  23. <field name="inherit_id" ref="partner_firstname.view_partner_form_firstname"/>
  24. <field name="arch" type="xml">
  25. <!-- Main form -->
  26. <field name="firstname" position="attributes">
  27. <attribute name="attrs">{'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
  28. </field>
  29. <field name="lastname" position="attributes">
  30. <attribute name="attrs">{'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
  31. </field>
  32. <field name="lastname" position="after">
  33. <field name="lastname2" attrs="{'required': [('firstname', '=', False), ('lastname', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}"/>
  34. </field>
  35. <!-- Inner contact form of child_ids -->
  36. <xpath expr="//field[@name='child_ids']/form//field[@name='firstname']" position="attributes">
  37. <attribute name="attrs">{'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
  38. </xpath>
  39. <xpath expr="//field[@name='child_ids']/form//field[@name='lastname']" position="attributes">
  40. <attribute name="attrs">{'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
  41. </xpath>
  42. <xpath expr="//field[@name='child_ids']/form//field[@name='lastname']" position="after">
  43. <field name="lastname2" attrs="{'required': [('firstname', '=', False), ('lastname', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}"/>
  44. </xpath>
  45. </field>
  46. </record>
  47. </odoo>