summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorXavier BOL (xbo) <xbo@odoo.com>2020-12-30 13:20:28 +0000
committerXavier BOL (xbo) <xbo@odoo.com>2021-01-04 09:11:31 +0000
commitd8f7d7369f060f444bcebc0118cc5a2a650f6361 (patch)
tree62462529b3e680d05ac79b8b9f2d5842adf5d897 /addons
parentcf2b0a505c117a50a91fa022bc1d6bf1eb6d9f77 (diff)
[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#63988 Related: odoo/enterprise#15522 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/sale_timesheet/models/project.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/sale_timesheet/models/project.py b/addons/sale_timesheet/models/project.py
index 35d4751731e..f3f9bdeb423 100644
--- a/addons/sale_timesheet/models/project.py
+++ b/addons/sale_timesheet/models/project.py
@@ -350,7 +350,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: