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.

47 lines
2.0 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- © 2014-2015 Tecnativa S.L. - Jairo Llopis
  3. © 2016 Tecnativa S.L. - Vicent Cubells
  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_department">
  7. <field name="name">Partner form with department</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. <xpath expr="//sheet/group//field[@name='function']" position="after">
  12. <field name="department_id"
  13. placeholder="Department"
  14. attrs="{'invisible': [('is_company','=', True)]}"
  15. options='{"no_open": True}'/>
  16. </xpath>
  17. <xpath expr="//field[@name='child_ids']/form//field[@name='function']"
  18. position="after">
  19. <field name="is_company" invisible="True"/>
  20. <field name="department_id"
  21. placeholder="Department"
  22. attrs="{'invisible': [('is_company','=', True)]}"
  23. options='{"no_open": True}'/>
  24. </xpath>
  25. </field>
  26. </record>
  27. <record model="ir.ui.view" id="view_res_partner_filter_department">
  28. <field name="name">Partner search with department</field>
  29. <field name="model">res.partner</field>
  30. <field name="inherit_id" ref="base.view_res_partner_filter"/>
  31. <field name="arch" type="xml">
  32. <field name="category_id" position="after">
  33. <field name="department_id"/>
  34. </field>
  35. <filter name="salesperson" position="after">
  36. <filter name="department"
  37. string="Department"
  38. domain="[('is_company', '=', False)]"
  39. context="{'group_by': 'department_id'}"/>
  40. </filter>
  41. </field>
  42. </record>
  43. </odoo>