Odoo Help


Payroll report error

on 3/17/15, 4:32 AM 1,027 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

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


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