summaryrefslogtreecommitdiff
path: root/addons/hr_holidays
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2021-02-24 14:05:07 +0000
committerGoffin Simon <sig@odoo.com>2021-03-15 08:49:14 +0000
commitaf8ce1d8891a4dcdeb80b069a114299d84e021f1 (patch)
treec8836bb9139442e93d6a308fed1b5485e09dd934 /addons/hr_holidays
parent735614a127499843bc7bd701794870234e743a88 (diff)
[FIX] hr_holidays: Rounding allocation_used_count and allocation_count
Steps to reproduce the bug: - Let's consider an employee E with 8.00 hours as Average Hour per Day - Create an Allocation for E with a Time-off Type in Hours (be sure the number of hours is different from the average hour per Day) - Open the form view of E Bug: The smart button Time Off(remaining leaves) was completely unreadable opw:2441019 closes odoo/odoo#66830 X-original-commit: c5282b15f4a9a785cb2ca44c58ab28ec4ee5f7ca Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Diffstat (limited to 'addons/hr_holidays')
-rw-r--r--addons/hr_holidays/models/hr_employee.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/hr_holidays/models/hr_employee.py b/addons/hr_holidays/models/hr_employee.py
index 7585a67cfe7..ceb0d2c5c52 100644
--- a/addons/hr_holidays/models/hr_employee.py
+++ b/addons/hr_holidays/models/hr_employee.py
@@ -87,12 +87,12 @@ class HrEmployeeBase(models.AbstractModel):
], ['number_of_days:sum', 'employee_id'], ['employee_id'])
rg_results = dict((d['employee_id'][0], d['number_of_days']) for d in data)
for employee in self:
- employee.allocation_count = rg_results.get(employee.id, 0.0)
+ employee.allocation_count = float_round(rg_results.get(employee.id, 0.0), precision_digits=2)
employee.allocation_display = "%g" % employee.allocation_count
def _compute_total_allocation_used(self):
for employee in self:
- employee.allocation_used_count = employee.allocation_count - employee.remaining_leaves
+ employee.allocation_used_count = float_round(employee.allocation_count - employee.remaining_leaves, precision_digits=2)
employee.allocation_used_display = "%g" % employee.allocation_used_count
def _compute_presence_state(self):