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.

108 lines
5.1 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- © 2015 Antiun Ingenieria S.L. - Javier Iniesta
  3. License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
  4. <odoo>
  5. <record model="ir.ui.view" id="view_partner_form_sector">
  6. <field name="name">Partner form with sector</field>
  7. <field name="model">res.partner</field>
  8. <field name="inherit_id" ref="base.view_partner_form"/>
  9. <field name="arch" type="xml">
  10. <field name="phone" position="before">
  11. <field name="sector_id" placeholder="Sector"
  12. options='{"no_open": True}'
  13. attrs="{'invisible': [('is_company', '=', False)]}"/>
  14. <field name="secondary_sector_ids" widget="many2many_tags"
  15. attrs="{'invisible': [('is_company', '=', False)]}"/>
  16. </field>
  17. <xpath expr="//field[@name='child_ids']/form//field[@name='title']" position="after">
  18. <field name="is_company" invisible="1"/>
  19. <field name="sector_id" placeholder="Sector"
  20. options='{"no_open": True}'
  21. attrs="{'invisible': [('is_company', '=', False)]}"/>
  22. <field name="secondary_sector_ids" widget="many2many_tags"
  23. attrs="{'invisible': [('is_company', '=', False)]}"/>
  24. </xpath>
  25. </field>
  26. </record>
  27. <record model="ir.ui.view" id="view_partner_tree_sector">
  28. <field name="name">Partner tree with sector</field>
  29. <field name="model">res.partner</field>
  30. <field name="inherit_id" ref="base.view_partner_tree"/>
  31. <field name="arch" type="xml">
  32. <field name="email" position="after">
  33. <field name="sector_id"
  34. attrs="{'invisible': [('is_company', '=', False)]}"/>
  35. </field>
  36. </field>
  37. </record>
  38. <record model="ir.ui.view" id="view_res_partner_filter_sector">
  39. <field name="name">Partner search with sector</field>
  40. <field name="model">res.partner</field>
  41. <field name="inherit_id" ref="base.view_res_partner_filter"/>
  42. <field name="arch" type="xml">
  43. <field name="category_id" position="after">
  44. <field name="sector_id"
  45. string="Sector"
  46. filter_domain="['|',('sector_id','ilike',self),
  47. ('secondary_sector_ids.name','ilike',self)]"/>
  48. </field>
  49. <filter name="salesperson" position="after">
  50. <filter name="sector"
  51. string="Sector"
  52. domain="[('is_company','=', True)]"
  53. context="{'group_by': 'sector_id'}"/>
  54. </filter>
  55. </field>
  56. </record>
  57. <!-- Views activated for group_use_partner_sector_for_person -->
  58. <record model="ir.ui.view" id="view_partner_form_sector_person">
  59. <field name="name">Partner form with sector</field>
  60. <field name="model">res.partner</field>
  61. <field name="inherit_id" ref="partner_sector.view_partner_form_sector"/>
  62. <field name="groups_id" eval="[(4, ref('partner_sector.group_use_partner_sector_for_person'))]"/>
  63. <field name="arch" type="xml">
  64. <field name="sector_id" position="attributes">
  65. <attribute name="attrs">{'invisible': 0}</attribute>
  66. </field>
  67. <field name="secondary_sector_ids" position="attributes">
  68. <attribute name="attrs">{'invisible': 0}</attribute>
  69. </field>
  70. <xpath expr="//field[@name='child_ids']/form//field[@name='sector_id']" position="attributes">
  71. <attribute name="attrs">{'invisible': 0}</attribute>
  72. </xpath>
  73. <xpath expr="//field[@name='child_ids']/form//field[@name='secondary_sector_ids']" position="attributes">
  74. <attribute name="attrs">{'invisible': 0}</attribute>
  75. </xpath>
  76. </field>
  77. </record>
  78. <record model="ir.ui.view" id="view_partner_tree_sector_person">
  79. <field name="name">Partner tree with sector</field>
  80. <field name="model">res.partner</field>
  81. <field name="inherit_id" ref="partner_sector.view_partner_tree_sector"/>
  82. <field name="groups_id" eval="[(4, ref('partner_sector.group_use_partner_sector_for_person'))]"/>
  83. <field name="arch" type="xml">
  84. <field name="sector_id" position="attributes">
  85. <attribute name="attrs">{'invisible': 0}</attribute>
  86. </field>
  87. </field>
  88. </record>
  89. <record model="ir.ui.view" id="view_res_partner_filter_sector_person">
  90. <field name="name">Partner search with sector</field>
  91. <field name="model">res.partner</field>
  92. <field name="inherit_id" ref="partner_sector.view_res_partner_filter_sector"/>
  93. <field name="groups_id" eval="[(4, ref('partner_sector.group_use_partner_sector_for_person'))]"/>
  94. <field name="arch" type="xml">
  95. <filter name="sector" position="attributes">
  96. <attribute name="domain"/>
  97. </filter>
  98. </field>
  99. </record>
  100. </odoo>