Odoo Help
Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM
|
e-Commerce
|
Accounting
|
Inventory
|
PoS
|
Project management
|
MRP
|
etc.
TypeError: get_employee_lines() takes exactly 5 arguments (4 given) [Closed]
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 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.
RegisterOdoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.
Test it nowQuestion tools
Stats
Asked: 8/25/15, 11:36 AM |
Seen: 486 times |
Last updated: 8/26/15, 12:58 PM |