Odoo Help


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.


Payroll report error

on 3/17/15, 4:32 AM 601 views

Hi everybody,

i want do create a report for payslip and right this code but i am getting error. Can we help me?

    def _get_payslip_lines(self, form, pay_id):
payslip_obj = self.pool.get('hr.payslip')
payslip_line = self.pool.get('hr.payslip.line')
payment_mode = self.pool.get('payment.mode')
payslip_lines = []
res = []
register_id = form.get('resgister_id', [])
register_id = register_id and register_id[0] or False
self.regi_total = 0.0
self.cr.execute("SELECT pl.id from hr_payslip_line as pl "\
"LEFT JOIN hr_payslip AS hp on (pl.slip_id = hp.id) "\
"LEFT JOIN payment_mode AS pm on (hp.payment_mode_id = pm.id) "\
"WHERE (hp.date_from >= %s) AND (hp.date_to <= %s) "\
"AND pl.register_id = %s "\
"AND hp.payment_mode_id = %s "\
"AND hp.state = 'done' "\
"ORDER BY pl.slip_id, pl.sequence",
(self.date_from, self.date_to, register_id, pay_id,))
payslip_lines = [x[0] for x in self.cr.fetchall()]
for line in payslip_line.browse(self.cr, self.uid, payslip_lines):
'payslip_name': line.slip_id.name,
'employee_bank_acc': line.slip_id.employee_id.bank_account_id.acc_number,
'name': line.name,
'code': line.code,
'quantity': line.quantity,
'amount': line.amount,
'total': line.total,
self.regi_total += line.total
return res

the error get is :

get_payslip_lines() takes exactly 3 arguments (2 given)

(<type 'exceptions.TypeError'>, TypeError('_get_payslip_lines() takes exactly 3 arguments (2 given)',), <traceback object at 0x7fb52c072f80>)

Where and how you call _get_payslip_lines?

on 3/17/15, 1:16 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)


Asked: 3/17/15, 4:32 AM
Seen: 601 times
Last updated: 3/17/15, 1:16 PM