From baed2f0e74d3a8355d3fd3f581ef48503c2d4843 Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Wed, 30 Dec 2020 13:20:28 +0000 Subject: [PATCH] [FIX] sale_timesheet: condition always False Before this commit, we check if the bill_type in the project is equal to 'customer_type' but this field can only be either 'customer_task' or 'customer_project'. Thus, this condition will always be False. This commit changes the condition to check if the bill_type is equal to 'customer_project'. Then, this condition can be True if the project has a SOL and his bill_type field is equal to 'customer_project'. closes odoo/odoo#64012 X-original-commit: d8f7d7369f060f444bcebc0118cc5a2a650f6361 Related: odoo/enterprise#15540 Signed-off-by: Yannick Tivisse (yti) --- addons/sale_timesheet/models/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_timesheet/models/project.py b/addons/sale_timesheet/models/project.py index ab2345c0fd8..13d2775fd03 100644 --- a/addons/sale_timesheet/models/project.py +++ b/addons/sale_timesheet/models/project.py @@ -356,7 +356,7 @@ class ProjectTask(models.Model): if not self.commercial_partner_id or not self.allow_billable: return False domain = [('is_service', '=', True), ('order_partner_id', 'child_of', self.commercial_partner_id.id), ('is_expense', '=', False), ('state', 'in', ['sale', 'done'])] - if self.project_id.bill_type == 'customer_type' and self.project_sale_order_id: + if self.project_id.bill_type == 'customer_project' and self.project_sale_order_id: domain.append(('order_id', '=?', self.project_sale_order_id.id)) sale_lines = self.env['sale.order.line'].search(domain) for line in sale_lines: