From 193707632dd5cf068ccf5819014be4cfac821e61 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 25 Aug 2017 14:10:57 +0200 Subject: [PATCH] [FIX] sale_timesheet: apply correct discount in revenue computation Related to https://github.com/odoo/odoo/commit/aec6248bb379c1ece02f5d4f718566c770fc2c6f --- addons/sale_timesheet/models/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_timesheet/models/account.py b/addons/sale_timesheet/models/account.py index 7e6e70c50b8..1f1737e86ef 100644 --- a/addons/sale_timesheet/models/account.py +++ b/addons/sale_timesheet/models/account.py @@ -134,7 +134,7 @@ class AccountAnalyticLine(models.Model): total_revenue_invoiced = sum(analytic_lines.mapped('timesheet_revenue')) # compute (new) revenue of current timesheet line revenue = min( - analytic_account.currency_id.round(unit_amount * so_line.currency_id.compute(so_line.price_unit, analytic_account.currency_id) * (1-so_line.discount)), + analytic_account.currency_id.round(unit_amount * so_line.currency_id.compute(so_line.price_unit, analytic_account.currency_id) * (1-(so_line.discount/100))), total_revenue_so - total_revenue_invoiced ) billable_type = 'billable_fixed'