sale_order_views.xml 1.9 KB

12345678910111213141516171819202122232425262728293031
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="view_order_form_inherit_sale_project" model="ir.ui.view">
  4. <field name="name">sale.order.form.sale.project</field>
  5. <field name="model">sale.order</field>
  6. <field name="inherit_id" ref="sale.view_order_form"/>
  7. <field name="priority">10</field>
  8. <field name="arch" type="xml">
  9. <xpath expr="//button[@name='action_view_invoice']" position="before">
  10. <field name="project_ids" invisible="1"/>
  11. <field name="is_product_milestone" invisible="1"/>
  12. <button type="object" name="action_view_project_ids" class="oe_stat_button" icon="fa-puzzle-piece" attrs="{'invisible': ['|', ('state', 'in', ['draft', 'sent']), ('project_ids', '=', [])]}" groups="project.group_project_user">
  13. <field name="project_count" widget="statinfo" string="Projects"/>
  14. </button>
  15. <button class="oe_stat_button" name="action_view_milestone" type="object" icon="fa-check-square-o" attrs="{'invisible': ['|', '|', ('is_product_milestone', '=', False), ('project_ids', '=', []), ('state', '=', 'draft')]}" groups="project.group_project_milestone">
  16. <field name="milestone_count" widget="statinfo" string="Milestones"/>
  17. </button>
  18. <button type="object" name="action_view_task" class="oe_stat_button" icon="fa-tasks" attrs="{'invisible': [('tasks_count', '=', 0)]}" groups="project.group_project_user">
  19. <field name="tasks_count" widget="statinfo" string="Tasks"/>
  20. </button>
  21. </xpath>
  22. <xpath expr="//field[@name='analytic_account_id']" position="after">
  23. <field name="visible_project" invisible="1"/>
  24. <field name="project_id" options="{'no_create': True}" attrs="{'invisible': [('visible_project', '=', False)]}"/>
  25. </xpath>
  26. </field>
  27. </record>
  28. </odoo>