[FIX] sale_timesheet: hide SO in project's settings if not billable
Current behaviour:
You can see the `Sales Order Item` field in the project's `Settings`
sheet page when the project is not `Billable`.
Expected behaviour:
If the project is not `Billable`, we hide the field `Sales Order Item`.
Steps to reproduce:
- Install `sale_timesheet`.
- Project > kebab-menu on project > Settings
- Click on the Settings tab of the project's form view
- Observe there is a `Sales Order Item` field, even if the project
is not Billable.
Reason for the problem:
Before, `Sales Order Item` was in the Invoicing tab, which is
visible only when the project is billable and a partner is set.
Due to a recent refactoring (b77f60b155),
the field was moved to the `Settings`, but the visibility condition
that was on the invoicing tab was not.
Fix:
Add the missing visibility condition on the field `sale_line_id`.
Affected versions:
- saas-16.1
- saas-16.2
- master
opw-3250937
closes odoo/odoo#117546
X-original-commit: ea97fb5be0ae3d40940f7befac6a2bc19c89b084
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
<field name="inherit_id" ref="hr_timesheet.project_invoice_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='settings']//field[@name='analytic_account_id']" position="before">
|
||||
<field name="sale_line_id" groups="!sales_team.group_sale_salesman" options="{'no_create': True, 'no_edit': True, 'delete': False, 'no_open': True}"/>
|
||||
<field name="sale_line_id" groups="sales_team.group_sale_salesman" options="{'no_create': True, 'no_edit': True, 'delete': False}"/>
|
||||
<field name="sale_line_id" groups="!sales_team.group_sale_salesman" options="{'no_create': True, 'no_edit': True, 'delete': False, 'no_open': True}" attrs="{'invisible': ['|', ('allow_billable', '=', False), ('partner_id', '=', False)]}"/>
|
||||
<field name="sale_line_id" groups="sales_team.group_sale_salesman" options="{'no_create': True, 'no_edit': True, 'delete': False}" attrs="{'invisible': ['|', ('allow_billable', '=', False), ('partner_id', '=', False)]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='settings']" position="after">
|
||||
<page name="billing_employee_rate" string="Invoicing" attrs="{'invisible': ['|', ('allow_billable', '=', False), ('partner_id', '=', False)]}">
|
||||
|
||||
Reference in New Issue
Block a user