From 863662ffe018320574561d284b9d7ddeb9e02ae9 Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Mon, 15 Feb 2021 10:06:42 +0100 Subject: [PATCH] [IMP] sale_project: not filter SOLs if SO defined in project Before this commit, when the pricing type of the project is either project rate or employee rate, the list of possible SOLs in sale_line_id is filtered to have only the SOLs in the SO. This commit removes this filter because we just want to use the SOL set in the project as a default value. task-2442683 closes odoo/odoo#66181 --- addons/sale_project/models/project.py | 2 +- addons/sale_project/views/project_task_views.xml | 1 - addons/sale_timesheet/views/project_task_views.xml | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/sale_project/models/project.py b/addons/sale_project/models/project.py index 2e30ae70eca..22f021c47d9 100644 --- a/addons/sale_project/models/project.py +++ b/addons/sale_project/models/project.py @@ -53,7 +53,7 @@ class ProjectTask(models.Model): sale_order_id = fields.Many2one('sale.order', 'Sales Order', help="Sales order to which the task is linked.") sale_line_id = fields.Many2one( - 'sale.order.line', 'Sales Order Item', domain="[('is_service', '=', True), ('order_partner_id', 'child_of', commercial_partner_id), ('is_expense', '=', False), ('state', 'in', ['sale', 'done']), ('order_id', '=?', project_sale_order_id)]", + 'sale.order.line', 'Sales Order Item', domain="[('is_service', '=', True), ('order_partner_id', 'child_of', commercial_partner_id), ('is_expense', '=', False), ('state', 'in', ['sale', 'done'])]", compute='_compute_sale_line', store=True, readonly=False, copy=False, help="Sales order item to which the project is linked. Link the timesheet entry to the sales order item defined on the project. " "Only applies on tasks without sale order item defined, and if the employee is not in the 'Employee/Sales Order Item Mapping' of the project.") diff --git a/addons/sale_project/views/project_task_views.xml b/addons/sale_project/views/project_task_views.xml index 2d2bd57e83e..465b1f1428d 100644 --- a/addons/sale_project/views/project_task_views.xml +++ b/addons/sale_project/views/project_task_views.xml @@ -46,7 +46,6 @@ - diff --git a/addons/sale_timesheet/views/project_task_views.xml b/addons/sale_timesheet/views/project_task_views.xml index 2e72e04decb..31d1f56b55e 100644 --- a/addons/sale_timesheet/views/project_task_views.xml +++ b/addons/sale_timesheet/views/project_task_views.xml @@ -154,7 +154,7 @@