commit
8feea92bda
|
|
@ -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))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue