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.

157 lines
6.3 KiB

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!-- Copyright 2015 Antiun Ingenieria S.L. - Javier Iniesta
  3. Copyright 2018 Eficent Business and IT Consulting Services, S.L. - Jordi Ballester
  4. License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
  5. <odoo>
  6. <record model="ir.ui.view" id="view_partner_form_industry">
  7. <field name="name">Partner form with industry</field>
  8. <field name="model">res.partner</field>
  9. <field name="inherit_id" ref="base.view_partner_form" />
  10. <field name="arch" type="xml">
  11. <field name="industry_id" position="after">
  12. <field
  13. name="secondary_industry_ids"
  14. widget="many2many_tags"
  15. attrs="{'invisible': [('is_company', '=', False)]}"
  16. />
  17. </field>
  18. <xpath
  19. expr="//field[@name='child_ids']/form//field[@name='title']"
  20. position="after"
  21. >
  22. <field name="is_company" invisible="1" />
  23. <field
  24. name="industry_id"
  25. placeholder="Sector"
  26. options='{"no_open": True}'
  27. attrs="{'invisible': [('is_company', '=', False)]}"
  28. />
  29. <field
  30. name="secondary_industry_ids"
  31. widget="many2many_tags"
  32. attrs="{'invisible': [('is_company', '=', False)]}"
  33. />
  34. </xpath>
  35. </field>
  36. </record>
  37. <record model="ir.ui.view" id="view_partner_tree_industry">
  38. <field name="name">Partner tree with industry</field>
  39. <field name="model">res.partner</field>
  40. <field name="inherit_id" ref="base.view_partner_tree" />
  41. <field name="arch" type="xml">
  42. <field name="email" position="after">
  43. <field
  44. name="industry_id"
  45. attrs="{'invisible': [('is_company', '=', False)]}"
  46. />
  47. </field>
  48. </field>
  49. </record>
  50. <record model="ir.ui.view" id="view_res_partner_filter_industry">
  51. <field name="name">Partner search with industry</field>
  52. <field name="model">res.partner</field>
  53. <field name="inherit_id" ref="base.view_res_partner_filter" />
  54. <field name="arch" type="xml">
  55. <field name="category_id" position="after">
  56. <field
  57. name="industry_id"
  58. string="Industry"
  59. filter_domain="['|',('industry_id','ilike',self),
  60. ('secondary_industry_ids.name','ilike',self)]"
  61. />
  62. </field>
  63. <filter name="salesperson" position="after">
  64. <filter
  65. name="industry"
  66. string="Industry"
  67. domain="[('is_company','=', True)]"
  68. context="{'group_by': 'industry_id'}"
  69. />
  70. </filter>
  71. </field>
  72. </record>
  73. <!-- Views activated for group_use_partner_industry_for_person -->
  74. <record model="ir.ui.view" id="view_partner_form_industry_person0">
  75. <field name="name">Partner form with industry</field>
  76. <field name="model">res.partner</field>
  77. <field name="inherit_id" ref="base.view_partner_form" />
  78. <field
  79. name="groups_id"
  80. eval="[(4, ref('partner_industry_secondary.group_use_partner_industry_for_person'))]"
  81. />
  82. <field name="arch" type="xml">
  83. <xpath
  84. expr="//page/group/group/field[@name='industry_id']"
  85. position="attributes"
  86. >
  87. <attribute name="attrs">{'invisible': 0}</attribute>
  88. </xpath>
  89. </field>
  90. </record>
  91. <record model="ir.ui.view" id="view_partner_form_industry_person">
  92. <field name="name">Partner form with industry</field>
  93. <field name="model">res.partner</field>
  94. <field
  95. name="inherit_id"
  96. ref="partner_industry_secondary.view_partner_form_industry"
  97. />
  98. <field
  99. name="groups_id"
  100. eval="[(4, ref('partner_industry_secondary.group_use_partner_industry_for_person'))]"
  101. />
  102. <field name="arch" type="xml">
  103. <xpath
  104. expr="//page/group/group/field[@name='secondary_industry_ids']"
  105. position="attributes"
  106. >
  107. <attribute name="attrs">{'invisible': 0}</attribute>
  108. </xpath>
  109. <xpath
  110. expr="//field[@name='child_ids']/form//field[@name='industry_id']"
  111. position="attributes"
  112. >
  113. <attribute name="attrs">{'invisible': 0}</attribute>
  114. </xpath>
  115. <xpath
  116. expr="//field[@name='child_ids']/form//field[@name='secondary_industry_ids']"
  117. position="attributes"
  118. >
  119. <attribute name="attrs">{'invisible': 0}</attribute>
  120. </xpath>
  121. </field>
  122. </record>
  123. <record model="ir.ui.view" id="view_partner_tree_industry_person">
  124. <field name="name">Partner tree with industry</field>
  125. <field name="model">res.partner</field>
  126. <field
  127. name="inherit_id"
  128. ref="partner_industry_secondary.view_partner_tree_industry"
  129. />
  130. <field
  131. name="groups_id"
  132. eval="[(4, ref('partner_industry_secondary.group_use_partner_industry_for_person'))]"
  133. />
  134. <field name="arch" type="xml">
  135. <field name="industry_id" position="attributes">
  136. <attribute name="attrs">{'invisible': 0}</attribute>
  137. </field>
  138. </field>
  139. </record>
  140. <record model="ir.ui.view" id="view_res_partner_filter_industry_person">
  141. <field name="name">Partner search with industry</field>
  142. <field name="model">res.partner</field>
  143. <field
  144. name="inherit_id"
  145. ref="partner_industry_secondary.view_res_partner_filter_industry"
  146. />
  147. <field
  148. name="groups_id"
  149. eval="[(4, ref('partner_industry_secondary.group_use_partner_industry_for_person'))]"
  150. />
  151. <field name="arch" type="xml">
  152. <filter name="industry" position="attributes">
  153. <attribute name="domain" />
  154. </filter>
  155. </field>
  156. </record>
  157. </odoo>