From 9c01e06f06cff8e237392cfde7bb9670b5d5259e Mon Sep 17 00:00:00 2001 From: "Laurent Stukkens (LTU)" Date: Mon, 7 Dec 2020 16:09:10 +0100 Subject: [FIX] project_sale: prevent invalid SOL on project Prior to this commit: - The user could set a SOL which product was not of 'service' type. After this commit: - The user will no more be able to set a SOL which product is not of 'service' type. task-2409761 --- addons/sale_project/models/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_project/models/project.py b/addons/sale_project/models/project.py index a5050f2f80f..02eed4af3aa 100644 --- a/addons/sale_project/models/project.py +++ b/addons/sale_project/models/project.py @@ -12,7 +12,7 @@ class Project(models.Model): sale_line_id = fields.Many2one( 'sale.order.line', 'Sales Order Item', copy=False, - domain="[('is_expense', '=', False), ('order_id', '=', sale_order_id), ('state', 'in', ['sale', 'done']), '|', ('company_id', '=', False), ('company_id', '=', company_id)]", + domain="[('is_service', '=', True), ('is_expense', '=', False), ('order_id', '=', sale_order_id), ('state', 'in', ['sale', 'done']), '|', ('company_id', '=', False), ('company_id', '=', company_id)]", 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.") sale_order_id = fields.Many2one('sale.order', 'Sales Order', domain="[('partner_id', '=', partner_id)]", copy=False, help="Sales order to which the project is linked.") -- cgit v1.2.3