From 026064c3c9be12adf181a101d7619595e070251b Mon Sep 17 00:00:00 2001 From: jem-odoo Date: Mon, 8 Oct 2018 09:55:45 +0000 Subject: [PATCH] [FIX] sale_timesheet: include milestone in profitability report The project overview is based on the profitability report to get the amount invoiced and to invoice for service sold on a sale order linked to a project. This request is wrong as it does not take the milestone sale line into account. This commit fixes it. opw-1890106 closes odoo/odoo#27538 --- .../report/project_profitability_report_analysis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale_timesheet/report/project_profitability_report_analysis.py b/addons/sale_timesheet/report/project_profitability_report_analysis.py index 366df3cc970..2ec12acea09 100644 --- a/addons/sale_timesheet/report/project_profitability_report_analysis.py +++ b/addons/sale_timesheet/report/project_profitability_report_analysis.py @@ -64,11 +64,11 @@ class ProfitabilityAnalysis(models.Model): ELSE 0.0 END AS expense_amount_untaxed_invoiced, CASE - WHEN SOL.qty_delivered_method = 'timesheet' THEN (SOL.untaxed_amount_to_invoice / CASE COALESCE(S.currency_rate, 0) WHEN 0 THEN 1.0 ELSE S.currency_rate END) + WHEN SOL.qty_delivered_method IN ('timesheet', 'manual') THEN (SOL.untaxed_amount_to_invoice / CASE COALESCE(S.currency_rate, 0) WHEN 0 THEN 1.0 ELSE S.currency_rate END) ELSE 0.0 END AS amount_untaxed_to_invoice, CASE - WHEN SOL.qty_delivered_method = 'timesheet' THEN (SOL.untaxed_amount_invoiced / CASE COALESCE(S.currency_rate, 0) WHEN 0 THEN 1.0 ELSE S.currency_rate END) + WHEN SOL.qty_delivered_method IN ('timesheet', 'manual') THEN (SOL.untaxed_amount_invoiced / CASE COALESCE(S.currency_rate, 0) WHEN 0 THEN 1.0 ELSE S.currency_rate END) ELSE 0.0 END AS amount_untaxed_invoiced, COST_SUMMARY.timesheet_unit_amount AS timesheet_unit_amount,