[IMP] sale_project: hide task SOL field with no customer

This commit hides the "Sales Order Line" field on tasks when no customer is set on them.
It doesn't really make sense to have a SOL without a partner, and it eases other flows to be able to assume that a SOL implies that there is a partner.

Task-3278895
This commit is contained in:
Vincent Larcin
2023-07-20 07:58:41 +02:00
committed by Xavier Bol (xbo)
parent a745194e45
commit 8e4525b2c5
@@ -186,8 +186,8 @@
</xpath>
<xpath expr="//field[@name='partner_id']" 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}" attrs="{'invisible': ['|', '|', ('allow_billable', '=', False), ('project_root_id', '=', False), ('sale_line_id', '=', 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}" placeholder="Non-billable" attrs="{'invisible': ['|', ('allow_billable', '=', False), ('project_root_id', '=', False)]}"/>
<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}" attrs="{'invisible': ['|', '|', '|', ('allow_billable', '=', False), ('project_root_id', '=', False), ('sale_line_id', '=', False), ('partner_id', '=', 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}" placeholder="Non-billable" attrs="{'invisible': ['|', '|', ('allow_billable', '=', False), ('project_root_id', '=', False), ('partner_id', '=', False)]}"/>
<field name="allow_billable" invisible="1"/>
</xpath>
<xpath expr="//field[@name='child_ids']/tree/field[@name='partner_id']" position="after">