[IMP] sale_timesheet: hide 'Invoicing' tab in project when no partner

Before this commit, when the partner is not defined in the project, we
show the 'Invoicing' tab only when the project is billable
(allow_billable=True) and the user could select an SOL and we
automatically set the project customer to the one in the SOL.

This commit directly hides the 'Invoicing' tab in the project form view
when no customer is defined or the project is not billable.
Now, if the project is billable, then the user will have to define the
customer to have this tab.

task-2638359
closes #76166

X-original-commit: ca40b7d804aef2dfa8eb1aad183979a7219b4270
This commit is contained in:
Xavier BOL (xbo)
2021-09-14 21:24:58 +02:00
committed by Laurent Stukkens (LTU)
parent 0302a262c8
commit 1ba83ad0ee
2 changed files with 8 additions and 8 deletions
@@ -178,13 +178,6 @@ tour.register('sale_timesheet_tour', {
actions.click(this.$anchor);
}
}
}, {
trigger: 'div.o_notebook_headers',
content: 'Click on Invoicing tab to configure the invoicing of this project.',
run: function (actions) {
const notebookId = $('div[name="sale_line_id"]').closest("div.tab-pane").attr('id');
actions.click(this.$anchor.find(`a[data-toggle="tab"][href="#${notebookId}"]`));
},
}, {
trigger: 'div[name="partner_id"]',
content: Markup('Add the customer for this project to select an SO and SOL for this customer <i>(e.g. Brandon Freeman)</i>.'),
@@ -195,6 +188,13 @@ tour.register('sale_timesheet_tour', {
trigger: 'ul.o_partner_autocomplete_dropdown > li:first-child > a:contains(Freeman)',
content: 'Select the customer in the autocomplete dropdown',
run: 'click',
}, {
trigger: 'div.o_notebook_headers',
content: 'Click on Invoicing tab to configure the invoicing of this project.',
run: function (actions) {
const notebookId = $('div[name="sale_line_id"]').closest("div.tab-pane").attr('id');
actions.click(this.$anchor.find(`a[data-toggle="tab"][href="#${notebookId}"]`));
},
}, {
trigger: 'div[name="sale_line_id"]',
content: 'Select a Sales Order Item as Default Sales Order Item for each task in this project.',
@@ -27,7 +27,7 @@
<button name="action_make_billable" string="Create Sales Order" type="object" attrs="{'invisible': [('display_create_order', '=', False)]}" groups="sales_team.group_sale_salesman"/>
</xpath>
<xpath expr="//page[@name='settings']" position="after">
<page name="billing_employee_rate" string="Invoicing" attrs="{'invisible': [('allow_billable', '=', False)]}">
<page name="billing_employee_rate" string="Invoicing" attrs="{'invisible': ['|', ('allow_billable', '=', False), ('partner_id', '=', False)]}">
<group>
<group>
<field name="display_create_order" invisible="1"/>