From 2eb9595f9673d27e8917fad05eee25ed743cea4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Thu, 28 Sep 2017 12:10:17 +0200 Subject: [PATCH] [FIX] sale_timesheet: better compute the to invoice and invoiced amount We now compute 'to invoice' and 'invoiced' amount directly from SO line fields and not the revenue. --- addons/sale_timesheet/controllers/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale_timesheet/controllers/main.py b/addons/sale_timesheet/controllers/main.py index 4fbdcca60ee..9b9635bd153 100644 --- a/addons/sale_timesheet/controllers/main.py +++ b/addons/sale_timesheet/controllers/main.py @@ -62,8 +62,8 @@ class SaleTimesheetController(http.Controller): dashboard_values['rates']['total'] += float_round(data.get('unit_amount') / dashboard_total_hours * 100, precision_rounding=hour_rounding) # money_amount - dashboard_values['money_amount']['invoiced'] = sum(values['timesheet_lines'].filtered(lambda l: l.timesheet_invoice_id).mapped('timesheet_revenue')) - dashboard_values['money_amount']['to_invoice'] = sum(values['timesheet_lines'].filtered(lambda l: not l.timesheet_invoice_id).mapped('timesheet_revenue')) + dashboard_values['money_amount']['invoiced'] = sum(values['timesheet_lines'].mapped('so_line.amt_invoiced')) + dashboard_values['money_amount']['to_invoice'] = sum(values['timesheet_lines'].mapped('so_line.amt_to_invoice')) dashboard_values['money_amount']['cost'] = sum(values['timesheet_lines'].mapped('amount')) dashboard_values['money_amount']['total'] = sum([dashboard_values['money_amount'][item] for item in dashboard_values['money_amount'].keys()])