This question has been flagged
1 Reply
2656 Views

Hello all,

I'm still not able to modify the _get_payslip_lines() method of the file report_contribution_register.py in my own module.

I want to add a line to this method.

How to inherit (override) this method in my own module?

Thanks

Avatar
Discard
Best Answer

Example: HRIS Module

'hr.overtime.application' object

py file:    hr_overtime_application.py
method: approve_all()

Custom module:

my_module.py

class hr_overtime_application(orm.Model):

_inherit = 'hr.overtime.application'


     def approve_all(self, cr, uid, ids, context=None): #same method name
         res = super(hr_overtime_application, self).approve_all(cr, uid, ids, context)
         #add the line

         return res

Hope it will help you :)



Avatar
Discard
Author

I would need an example please miss. Thank for your answer

Posted :)

Author

will check this soon. Thanks.