diff options
| author | Jérome Maes <jem@openerp.com> | 2017-09-28 12:10:17 +0200 |
|---|---|---|
| committer | Jérome Maes <jem@openerp.com> | 2017-09-29 13:05:35 +0200 |
| commit | 2eb9595f9673d27e8917fad05eee25ed743cea4c (patch) | |
| tree | 2205cdd529610bdcc14753a35684cae4d6e20dd3 | |
| parent | f0cfc2dd659a189f0cb4b178f28a8cf66feda2c0 (diff) | |
[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.
| -rw-r--r-- | addons/sale_timesheet/controllers/main.py | 4 |
1 files 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()]) |
