From 1ba83ad0eede2e5c30f0e3ae6a5df1ed570e950e Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Mon, 6 Sep 2021 13:14:24 +0200 Subject: [PATCH] [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 --- .../static/tests/tours/sale_timesheet_tour.js | 14 +++++++------- addons/sale_timesheet/views/project_task_views.xml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/sale_timesheet/static/tests/tours/sale_timesheet_tour.js b/addons/sale_timesheet/static/tests/tours/sale_timesheet_tour.js index 33ecfdeb765..acfe2888120 100644 --- a/addons/sale_timesheet/static/tests/tours/sale_timesheet_tour.js +++ b/addons/sale_timesheet/static/tests/tours/sale_timesheet_tour.js @@ -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 (e.g. Brandon Freeman).'), @@ -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.', diff --git a/addons/sale_timesheet/views/project_task_views.xml b/addons/sale_timesheet/views/project_task_views.xml index b5ba5e96fcd..53721e0f4df 100644 --- a/addons/sale_timesheet/views/project_task_views.xml +++ b/addons/sale_timesheet/views/project_task_views.xml @@ -27,7 +27,7 @@