[IMP] sale_project: move project stat button on SO

Prior to this commit, the project and task stat buttons were placed
before the invoice one.

After this commit, the project stat button will be placed before the
tasks stat button which will be before the sale order preview.

PR community : #75553
PR upgrade : odoo/upgrade#2777

task-2559061
This commit is contained in:
Thibault Libioulle
2021-08-30 16:47:48 +00:00
parent 8285412dbc
commit 4f7d450cef
@@ -5,17 +5,18 @@
<field name="name">sale.order.form.sale.project</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="priority">10</field>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_view_invoice']" position="before">
<button type="object" name="action_view_task" class="oe_stat_button" icon="fa-tasks" attrs="{'invisible': [('tasks_count', '=', 0)]}" groups="project.group_project_user">
<field name="tasks_count" widget="statinfo" string="Tasks"/>
</button>
<xpath expr="//button[@name='preview_sale_order']" position="before">
<button type="object" name="action_view_project_ids" class="oe_stat_button" icon="fa-puzzle-piece" attrs="{'invisible': ['|', ('project_ids', '=', []), ('project_overview', '=', True)]}" groups="project.group_project_manager">
<field name="project_ids" invisible="1"/>
<field name="project_overview" invisible="1"/>
<field name="project_count" widget="statinfo" string="Projects"/>
</button>
<button type="object" name="action_view_project_ids" class="oe_stat_button" icon="fa-puzzle-piece" string="Project Overview" attrs="{'invisible': ['|', ('project_ids', '=', []), ('project_overview', '=', False)]}" groups="project.group_project_manager"/>
<button type="object" name="action_view_task" class="oe_stat_button" icon="fa-tasks" attrs="{'invisible': [('tasks_count', '=', 0)]}" groups="project.group_project_user">
<field name="tasks_count" widget="statinfo" string="Tasks"/>
</button>
</xpath>
<xpath expr="//field[@name='analytic_account_id']" position="after">
<field name="visible_project" invisible="1"/>