summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoren Van Onder <jov@odoo.com>2018-10-29 12:29:22 -0700
committerJoren Van Onder <jov@odoo.com>2018-10-30 10:35:49 -0700
commitc2bc3381508bfb002cb9af3c3b6655273f8c07d6 (patch)
tree47f3ebbbf822d5bc32ff497d6037f920add08ef3
parentca3a1f51d83db4befac0836c5d6e377d6266c753 (diff)
[FIX] account_budget: properly calculate percentage sum in read_group
The percentage field is computed in _compute_percentage as a value between 0 and 1. This is good because that's what widget="percentage" in views expects. This makes read_group also return a value between 0 and 1, instead of 0 and 100. Otherwise list views will show e.g. 5000% when grouping lines that sum to 50%. Introduced in saas-11.4 at odoo/odoo@9148960174bdb0abbee6a5b7403a8f. *Do not forward port, already ported to 12.0 via odoo/enterprise#2975 (odoo/enterprise@a1484e650cb013f35755d)* opw-1904481
-rw-r--r--addons/account_budget/models/account_budget.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account_budget/models/account_budget.py b/addons/account_budget/models/account_budget.py
index d5500c2d623..0a92628cab4 100644
--- a/addons/account_budget/models/account_budget.py
+++ b/addons/account_budget/models/account_budget.py
@@ -145,7 +145,7 @@ class CrossoveredBudgetLines(models.Model):
if group_line['theoritical_amount']:
# use a weighted average
group_line['percentage'] = float(
- (group_line['practical_amount'] or 0.0) / group_line['theoritical_amount']) * 100
+ (group_line['practical_amount'] or 0.0) / group_line['theoritical_amount'])
return result