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.

105 lines
4.2 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  3. © 2015 Grupo ESOC Ingeniería de Servicios, S.L.U. -->
  4. <openerp>
  5. <data>
  6. <record id="partner_simple_form" model="ir.ui.view">
  7. <field name="name">Add second last name</field>
  8. <field name="model">res.partner</field>
  9. <field name="inherit_id"
  10. ref="partner_firstname.view_partner_simple_form_firstname"/>
  11. <field name="arch" type="xml">
  12. <data>
  13. <xpath expr="//field[@name='firstname']" position="attributes">
  14. <attribute name="attrs">{
  15. 'required': [('lastname', '=', False),
  16. ('lastname2', '=', False),
  17. ('is_company', '=', False)]
  18. }</attribute>
  19. </xpath>
  20. <xpath expr="//field[@name='lastname']" position="attributes">
  21. <attribute name="attrs">{
  22. 'required': [('firstname', '=', False),
  23. ('lastname2', '=', False),
  24. ('is_company', '=', False)]
  25. }</attribute>
  26. </xpath>
  27. <xpath expr="//field[@name='lastname']" position="after">
  28. <field name="lastname2"
  29. attrs="{'required': [('firstname', '=', False),
  30. ('lastname', '=', False),
  31. ('is_company', '=', False)]}"/>
  32. </xpath>
  33. </data>
  34. </field>
  35. </record>
  36. <record id="partner_form" model="ir.ui.view">
  37. <field name="name">Add second last name</field>
  38. <field name="model">res.partner</field>
  39. <field name="inherit_id"
  40. ref="partner_firstname.view_partner_form_firstname"/>
  41. <field name="arch" type="xml">
  42. <data>
  43. <!-- Main form -->
  44. <xpath expr="//field[@name='firstname']" position="attributes">
  45. <attribute name="attrs">{
  46. 'required': [('lastname', '=', False),
  47. ('lastname2', '=', False),
  48. ('is_company', '=', False)]
  49. }</attribute>
  50. </xpath>
  51. <xpath expr="//field[@name='lastname']" position="attributes">
  52. <attribute name="attrs">{
  53. 'required': [('firstname', '=', False),
  54. ('lastname2', '=', False),
  55. ('is_company', '=', False)]
  56. }</attribute>
  57. </xpath>
  58. <xpath expr="//field[@name='lastname']" position="after">
  59. <field name="lastname2"
  60. attrs="{'required': [('firstname', '=', False),
  61. ('lastname', '=', False),
  62. ('is_company', '=', False)]}"/>
  63. </xpath>
  64. <!-- Inner contact form of child_ids -->
  65. <xpath expr="//field[@name='child_ids']/form
  66. //field[@name='firstname']"
  67. position="attributes">
  68. <attribute name="attrs">{
  69. 'required': [('lastname', '=', False),
  70. ('lastname2', '=', False),
  71. ('is_company', '=', False)]
  72. }</attribute>
  73. </xpath>
  74. <xpath expr="//field[@name='child_ids']/form
  75. //field[@name='lastname']"
  76. position="attributes">
  77. <attribute name="attrs">{
  78. 'required': [('firstname', '=', False),
  79. ('lastname2', '=', False),
  80. ('is_company', '=', False)]
  81. }</attribute>
  82. </xpath>
  83. <xpath expr="//field[@name='child_ids']/form
  84. //field[@name='lastname']"
  85. position="after">
  86. <field name="lastname2"
  87. attrs="{'required': [('firstname', '=', False),
  88. ('lastname', '=', False),
  89. ('is_company', '=', False)]}"/>
  90. </xpath>
  91. </data>
  92. </field>
  93. </record>
  94. </data>
  95. </openerp>