How can I call a function from a salary rule of type python code?
I need to make a call to a function in the payslip object, named, for example, salaryfunction:
class HrNicPaySlip(models.Model): _inherit = 'hr.payslip' @api.multi def salaryfunction(self): return 100.00
I need to call this function from the salary of type python code calculation rule, like this:
result = payslip.salaryfunction()
But I get the next error when calculate the pay sheep:
Wrong python code defined for salary rule
In the log the error is:
ValueError: : "'float' object is not callable" while evaluating u'result = payslip.salaryfunction()'
Could you please help with that? the version of the odoo is 10 and 11
I searched about some similar issue but without success