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

TypeError: get_employee_lines() takes exactly 5 arguments (4 given) [Closed]

By
Drees Far
on 8/25/15, 11:36 AM 264 views

The Question has been closed for reason: duplicate question

by
Drees Far
on 08/26/2015 12:58:56

Here is my function in the python file:


def __init__(self, cr, uid, name, context):

print ('----------------------test--------------------------')

super(journal_paie, self).__init__(cr, uid, name, context)

self.localcontext.update({

'get_employee_lines': self.get_employee_lines,

})

def get_employee_lines(self, company_id, date_start, date_end):

payslip_line = self.pool.get('hr.payslip')

obj_ids = payslip_line.search([('company_id', '=', company_id), ('date_from', '=', date_start), ('date_to', '=', date_end)])

res = obj.read( obj_ids, ['employee_id'], context)

print res['employee_id']

return res



And in my sxw:

i did this:

[[ repeatIn(objects,'example') ]]

[[ repeatIn (get_employee_lines (example.company_id, example.date_start, example.date_end), 'p') ]]

but i got this error:


5-08-25 15:35:54,209 8358 ERROR company openerp.tools.safe_eval: Cannot eval "repeatIn (get_employee_lines (example.company_id, example.date_start, example.date_end), 'p')"

Traceback (most recent call last):

File "/opt/openerp/v7/server/openerp/tools/safe_eval.py", line 285, in safe_eval

return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)

File "", line 1, in <module>

TypeError: get_employee_lines() takes exactly 5 arguments (4 given)

2015-08-25 15:35:54,209 8358 ERROR company openerp.tools.safe_eval: Cannot eval 'p'

Traceback (most recent call last):

File "/opt/openerp/v7/server/openerp/tools/safe_eval.py", line 285, in safe_eval

return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)

File "", line 1, in <module>

NameError: name 'p' is not defined


About This Community

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

Question tools

1 follower(s)

Stats

Asked: 8/25/15, 11:36 AM
Seen: 264 times
Last updated: 8/26/15, 12:58 PM