project_sharing_views.xml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="project_sharing_inherit_project_task_view_form" model="ir.ui.view">
  4. <field name="name">project.task.view.inherit</field>
  5. <field name="model">project.task</field>
  6. <field name="inherit_id" ref="project.project_sharing_project_task_view_form"/>
  7. <field name="arch" type="xml">
  8. <div name="button_box" position="inside">
  9. <field name="display_sale_order_button" invisible="1"/>
  10. <button class="oe_stat_button"
  11. type="object" name="action_project_sharing_view_so" icon="fa-dollar"
  12. attrs="{'invisible': [('display_sale_order_button', '=', False)]}"
  13. string="Sales Order"/>
  14. </div>
  15. <xpath expr="//field[@name='partner_id']" position="attributes">
  16. <attribute name="options">{'no_open': True, 'no_create': True, 'no_edit': True}</attribute>
  17. <attribute name="context">{'res_partner_search_mode': 'customer'}</attribute>
  18. </xpath>
  19. <xpath expr="//field[@name='partner_id']" position="after">
  20. <field name="commercial_partner_id" invisible="1" />
  21. <field name="sale_line_id" string="Sales Order Item" attrs="{'invisible': [('partner_id', '=', False)]}" options='{"no_open": True}' readonly="1" context="{'create': False, 'edit': False, 'delete': False}"/>
  22. </xpath>
  23. </field>
  24. </record>
  25. <record id="project_sharing_inherit_project_task_view_search" model="ir.ui.view">
  26. <field name="name">project.task.search.inherit</field>
  27. <field name="model">project.task</field>
  28. <field name="inherit_id" ref="project.project_sharing_project_task_view_search"/>
  29. <field name="arch" type="xml">
  30. <xpath expr="//field[@name='partner_id']" position="after">
  31. <field name="sale_order_id" string="Sale Order" filter_domain="['|', ('sale_order_id', 'ilike', self), ('sale_line_id', 'ilike', self)]"/>
  32. </xpath>
  33. <xpath expr="//group/filter[@name='customer']" position="after">
  34. <filter name="sale_order_id" string="Sales Order Id" context="{'group_by': 'sale_order_id'}" />
  35. </xpath>
  36. </field>
  37. </record>
  38. </odoo>