Merge pull request #2802 from expsa/bakry_hr3

Bakry hr3
This commit is contained in:
bakry 2025-04-20 17:00:49 +03:00 committed by GitHub
commit 8feea92bda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -11,6 +11,8 @@ from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, tools, _, exceptions
from odoo.exceptions import UserError, except_orm
# solve Python uses "round half to even" by default
from decimal import Decimal, ROUND_HALF_UP
# New object for loans lines in payslip
class PayslipLoans(models.Model):
@ -2235,7 +2237,9 @@ class HrPayslipLine(models.Model):
line.total = round(((line.amount / 30) * work_days) * line.percentage / 100,2)
################################################### End IF Then else #################################################
else:
line.total = round((line.amount) * line.percentage / 100,2)
total = Decimal(line.amount * line.percentage / 100)
rounded = total.quantize(Decimal('0.01'), rounding=ROUND_HALF_UP)
line.total = round(rounded,2)
#print("compute_shee_computee_total payslips_Run %s" % (time.time() - start_time))