[FIX] hr_payroll: sum correctly category code
If amount = 1 and the category amount = -1, the sum is 0 and the returned value was amount instead of zero (`0 or amount`) Avoid this evalution error by splitting on multiple lines Closes #15470
This commit is contained in:
parent
0616016b47
commit
a6c2210770
|
@ -474,7 +474,9 @@ class hr_payslip(osv.osv):
|
||||||
def _sum_salary_rule_category(localdict, category, amount):
|
def _sum_salary_rule_category(localdict, category, amount):
|
||||||
if category.parent_id:
|
if category.parent_id:
|
||||||
localdict = _sum_salary_rule_category(localdict, category.parent_id, amount)
|
localdict = _sum_salary_rule_category(localdict, category.parent_id, amount)
|
||||||
localdict['categories'].dict[category.code] = category.code in localdict['categories'].dict and localdict['categories'].dict[category.code] + amount or amount
|
if category.code in localdict['categories'].dict:
|
||||||
|
amount += localdict['categories'].dict[category.code]
|
||||||
|
localdict['categories'].dict[category.code] = amount
|
||||||
return localdict
|
return localdict
|
||||||
|
|
||||||
class BrowsableObject(object):
|
class BrowsableObject(object):
|
||||||
|
|
Loading…
Reference in New Issue