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.

80 lines
3.7 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
  9. name="inherit_id"
  10. ref="partner_firstname.view_partner_simple_form_firstname"
  11. />
  12. <field name="arch" type="xml">
  13. <field name="firstname" position="attributes">
  14. <attribute
  15. name="attrs"
  16. >{'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
  17. </field>
  18. <field name="lastname" position="attributes">
  19. <attribute
  20. name="attrs"
  21. >{'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
  22. </field>
  23. <field name="lastname" position="after">
  24. <field
  25. name="lastname2"
  26. attrs="{'required': [('firstname', '=', False), ('lastname', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}"
  27. />
  28. </field>
  29. </field>
  30. </record>
  31. <record id="partner_form" model="ir.ui.view">
  32. <field name="model">res.partner</field>
  33. <field name="inherit_id" ref="partner_firstname.view_partner_form_firstname" />
  34. <field name="arch" type="xml">
  35. <!-- Main form -->
  36. <field name="firstname" position="attributes">
  37. <attribute
  38. name="attrs"
  39. >{'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
  40. </field>
  41. <field name="lastname" position="attributes">
  42. <attribute
  43. name="attrs"
  44. >{'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
  45. </field>
  46. <field name="lastname" position="after">
  47. <field
  48. name="lastname2"
  49. attrs="{'required': [('firstname', '=', False), ('lastname', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}"
  50. />
  51. </field>
  52. <!-- Inner contact form of child_ids -->
  53. <xpath
  54. expr="//field[@name='child_ids']/form//field[@name='firstname']"
  55. position="attributes"
  56. >
  57. <attribute
  58. name="attrs"
  59. >{'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
  60. </xpath>
  61. <xpath
  62. expr="//field[@name='child_ids']/form//field[@name='lastname']"
  63. position="attributes"
  64. >
  65. <attribute
  66. name="attrs"
  67. >{'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
  68. </xpath>
  69. <xpath
  70. expr="//field[@name='child_ids']/form//field[@name='lastname']"
  71. position="after"
  72. >
  73. <field
  74. name="lastname2"
  75. attrs="{'required': [('firstname', '=', False), ('lastname', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}"
  76. />
  77. </xpath>
  78. </field>
  79. </record>
  80. </odoo>