Skip to content
Snippets Groups Projects
Commit 8f793707 authored by Kartik Chavda's avatar Kartik Chavda
Browse files

[FIX] sale_{project,timesheet}: hide SOL field when task is not billable

This commit hide SOL field for project task form view and hide
it's value from tree view when task is not billable and give
correct xpath on SOL field attributes to display remaining hour
and price unit in name_search.

task-3018123

Part-of: odoo/odoo#103183
parent c1f331ba
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,7 @@
<xpath expr="//field[@name='partner_phone']" position="after">
<field name="sale_order_id" attrs="{'invisible': True}" groups="sales_team.group_sale_salesman"/>
<field name="sale_line_id" groups="!sales_team.group_sale_salesman" string="Sales Order Item" options='{"no_open": True}' readonly="1" context="{'create': False, 'edit': False, 'delete': False}"/>
<field name="sale_line_id" groups="sales_team.group_sale_salesman" string="Sales Order Item" options='{"no_create": True}' readonly="0" context="{'create': False, 'edit': False, 'delete': False}"/>
<field name="sale_line_id" groups="sales_team.group_sale_salesman" string="Sales Order Item" options='{"no_create": True}' readonly="0" context="{'create': False, 'edit': False, 'delete': False, 'with_price_unit': True}"/>
<field name="commercial_partner_id" invisible="1" />
</xpath>
</field>
......
......@@ -188,15 +188,13 @@
<field name="model">project.task</field>
<field name="inherit_id" ref="sale_project.view_sale_project_inherit_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='sale_line_id']" position="attributes">
<attribute name="context">{'with_remaining_hours': True, 'with_price_unit': True}</attribute>
<xpath expr="//field[@name='sale_line_id'][2]" position="attributes">
<attribute name="context">{'create': False, 'edit': False, 'delete': False, 'with_price_unit': True, 'with_remaining_hours': True}</attribute>
<!-- To do: move allow_billable field in sale_project and add attrs directly on field in master -->
<attribute name="attrs">
{'invisible': [('allow_billable', '=', False)]}
</attribute>
</xpath>
<xpath expr="//field[@name='sale_order_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
</odoo>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment