Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to modify the _get_payslip_lines() method in report_contribution_register.py?

By
Pascal Tremblay
on 1/20/16, 5:46 PM 457 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

0
Samantha Cruz
On 1/20/16, 10:06 PM

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 :)



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

Pascal Tremblay
on 1/20/16, 10:32 PM

Posted :)

Samantha Cruz
on 1/21/16, 6:47 PM

will check this soon. Thanks.

Pascal Tremblay
on 1/29/16, 8:09 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/20/16, 5:46 PM
Seen: 457 times
Last updated: 1/20/16, 10:06 PM