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.

115 lines
5.6 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 name="secondary_industry_ids" widget="many2many_tags"
  13. attrs="{'invisible': [('is_company', '=', False)]}"/>
  14. </field>
  15. <xpath expr="//field[@name='child_ids']/form//field[@name='title']" position="after">
  16. <field name="is_company" invisible="1"/>
  17. <field name="industry_id" placeholder="Sector"
  18. options='{"no_open": True}'
  19. attrs="{'invisible': [('is_company', '=', False)]}"/>
  20. <field name="secondary_industry_ids" widget="many2many_tags"
  21. attrs="{'invisible': [('is_company', '=', False)]}"/>
  22. </xpath>
  23. </field>
  24. </record>
  25. <record model="ir.ui.view" id="view_partner_tree_industry">
  26. <field name="name">Partner tree with industry</field>
  27. <field name="model">res.partner</field>
  28. <field name="inherit_id" ref="base.view_partner_tree"/>
  29. <field name="arch" type="xml">
  30. <field name="email" position="after">
  31. <field name="industry_id"
  32. attrs="{'invisible': [('is_company', '=', False)]}"/>
  33. </field>
  34. </field>
  35. </record>
  36. <record model="ir.ui.view" id="view_res_partner_filter_industry">
  37. <field name="name">Partner search with industry</field>
  38. <field name="model">res.partner</field>
  39. <field name="inherit_id" ref="base.view_res_partner_filter"/>
  40. <field name="arch" type="xml">
  41. <field name="category_id" position="after">
  42. <field name="industry_id"
  43. string="Industry"
  44. filter_domain="['|',('industry_id','ilike',self),
  45. ('secondary_industry_ids.name','ilike',self)]"/>
  46. </field>
  47. <filter name="salesperson" position="after">
  48. <filter name="industry"
  49. string="Industry"
  50. domain="[('is_company','=', True)]"
  51. context="{'group_by': 'industry_id'}"/>
  52. </filter>
  53. </field>
  54. </record>
  55. <!-- Views activated for group_use_partner_industry_for_person -->
  56. <record model="ir.ui.view" id="view_partner_form_industry_person0">
  57. <field name="name">Partner form with industry</field>
  58. <field name="model">res.partner</field>
  59. <field name="inherit_id" ref="base.view_partner_form"/>
  60. <field name="groups_id" eval="[(4, ref('partner_industry_secondary.group_use_partner_industry_for_person'))]"/>
  61. <field name="arch" type="xml">
  62. <xpath expr="//page/group/group/field[@name='industry_id']" position="attributes">
  63. <attribute name="attrs">{'invisible': 0}</attribute>
  64. </xpath>
  65. </field>
  66. </record>
  67. <record model="ir.ui.view" id="view_partner_form_industry_person">
  68. <field name="name">Partner form with industry</field>
  69. <field name="model">res.partner</field>
  70. <field name="inherit_id" ref="partner_industry_secondary.view_partner_form_industry"/>
  71. <field name="groups_id" eval="[(4, ref('partner_industry_secondary.group_use_partner_industry_for_person'))]"/>
  72. <field name="arch" type="xml">
  73. <xpath expr="//page/group/group/field[@name='secondary_industry_ids']" position="attributes">
  74. <attribute name="attrs">{'invisible': 0}</attribute>
  75. </xpath>
  76. <xpath expr="//field[@name='child_ids']/form//field[@name='industry_id']" position="attributes">
  77. <attribute name="attrs">{'invisible': 0}</attribute>
  78. </xpath>
  79. <xpath expr="//field[@name='child_ids']/form//field[@name='secondary_industry_ids']" position="attributes">
  80. <attribute name="attrs">{'invisible': 0}</attribute>
  81. </xpath>
  82. </field>
  83. </record>
  84. <record model="ir.ui.view" id="view_partner_tree_industry_person">
  85. <field name="name">Partner tree with industry</field>
  86. <field name="model">res.partner</field>
  87. <field name="inherit_id" ref="partner_industry_secondary.view_partner_tree_industry"/>
  88. <field name="groups_id" eval="[(4, ref('partner_industry_secondary.group_use_partner_industry_for_person'))]"/>
  89. <field name="arch" type="xml">
  90. <field name="industry_id" position="attributes">
  91. <attribute name="attrs">{'invisible': 0}</attribute>
  92. </field>
  93. </field>
  94. </record>
  95. <record model="ir.ui.view" id="view_res_partner_filter_industry_person">
  96. <field name="name">Partner search with industry</field>
  97. <field name="model">res.partner</field>
  98. <field name="inherit_id" ref="partner_industry_secondary.view_res_partner_filter_industry"/>
  99. <field name="groups_id" eval="[(4, ref('partner_industry_secondary.group_use_partner_industry_for_person'))]"/>
  100. <field name="arch" type="xml">
  101. <filter name="industry" position="attributes">
  102. <attribute name="domain"/>
  103. </filter>
  104. </field>
  105. </record>
  106. </odoo>