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.

90 lines
3.6 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <odoo>
  3. <record model="ir.ui.view" id="view_partner_form_nuts">
  4. <field name="name">Partner form with NUTS</field>
  5. <field name="model">res.partner</field>
  6. <field name="inherit_id" ref="base.view_partner_form" />
  7. <field name="arch" type="xml">
  8. <xpath expr="//sheet/group//field[@name='country_id']/.." position="after">
  9. <field name="allowed_nut_ids" invisible="1" />
  10. <field
  11. name="nuts1_id"
  12. context="{'default_country_id': country_id, 'default_level': 1}"
  13. />
  14. <field
  15. name="nuts2_id"
  16. context="{'default_country_id': country_id, 'default_level': 2, 'default_parent_id': nuts1_id}"
  17. />
  18. <field
  19. name="nuts3_id"
  20. context="{'default_country_id': country_id, 'default_level': 3, 'default_parent_id': nuts2_id}"
  21. />
  22. <field
  23. name="nuts4_id"
  24. context="{'default_country_id': country_id, 'default_level': 4, 'default_parent_id': nuts3_id}"
  25. />
  26. </xpath>
  27. <xpath
  28. expr="//field[@name='child_ids']/form//field[@name='country_id']/.."
  29. position="after"
  30. >
  31. <field name="allowed_nut_ids" invisible="1" />
  32. <field
  33. name="nuts1_id"
  34. context="{'default_country_id': country_id, 'default_level': 1}"
  35. />
  36. <field
  37. name="nuts2_id"
  38. context="{'default_country_id': country_id, 'default_level': 2, 'default_parent_id': nuts1_id}"
  39. />
  40. <field
  41. name="nuts3_id"
  42. context="{'default_country_id': country_id, 'default_level': 3, 'default_parent_id': nuts2_id}"
  43. />
  44. <field
  45. name="nuts4_id"
  46. context="{'default_country_id': country_id, 'default_level': 4, 'default_parent_id': nuts3_id}"
  47. />
  48. </xpath>
  49. </field>
  50. </record>
  51. <record model="ir.ui.view" id="view_res_partner_filter_nuts">
  52. <field name="name">Partner search with NUTS</field>
  53. <field name="model">res.partner</field>
  54. <field name="inherit_id" ref="base.view_res_partner_filter" />
  55. <field name="arch" type="xml">
  56. <field name="category_id" position="after">
  57. <field name="nuts1_id" />
  58. <field name="nuts2_id" />
  59. <field name="nuts3_id" />
  60. <field name="nuts4_id" />
  61. </field>
  62. <filter name="salesperson" position="after">
  63. <filter
  64. name="nuts_l1"
  65. string="NUTS L1"
  66. domain="[]"
  67. context="{'group_by': 'nuts1_id'}"
  68. />
  69. <filter
  70. name="nuts_l2"
  71. string="NUTS L2"
  72. domain="[]"
  73. context="{'group_by': 'nuts2_id'}"
  74. />
  75. <filter
  76. name="nuts_l3"
  77. string="NUTS L3"
  78. domain="[]"
  79. context="{'group_by': 'nuts3_id'}"
  80. />
  81. <filter
  82. name="nuts_l4"
  83. string="NUTS L4"
  84. domain="[]"
  85. context="{'group_by': 'nuts4_id'}"
  86. />
  87. </filter>
  88. </field>
  89. </record>
  90. </odoo>