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.

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