Odoo Help


What is "Invalid field %r in leaf %r" % (left, str(leaf))" ?

Anirudh Lou
on 11/17/14, 8:33 PM 2,635 views

Hi every one, do you know what is the cause of invalid field %r in leaf %r means? I don't know why it pops up in my openerp. I am trying to search payslip_id on it's payslip_line using this code:

working_student_id = payslip_obj.search(cr,uid,[('employee_id','=',emp.id),('date_from','>=',start_date_range),('date_to','<=',november_range)],context=context)
                        for payslip in payslip_obj.browse(cr,uid,working_student_id,context=context):
                            netsvc.Logger().notifyChannel("WILL I BE EXCUTED?: ", netsvc.LOG_INFO,str(payslip)+' '+str(payslip.id))
                            cont = payslip.contract_id.id
                            wage_type = payslip.contract_id.emp_type
                            if wage_type == 'monthly':
                                wage_type = 'semi_monthly'
                            line_ids = payslip_line_obj.search(cr,uid,[('payslip_id','=',payslip.id)],context=context)
                            netsvc.Logger().notifyChannel("TRY ONCE AGAIN: ", netsvc.LOG_INFO, 'AM I IN????  ' + str(payslip.id))

When i run it, It canot executes this line:

line_ids = payslip_line_obj.search(cr,uid,[('payslip_id','=',payslip.id)],context=context)

Here is what the terminal says:

raise ValueError("Invalid field %r in leaf %r" % (left, str(leaf)))
ValueError: Invalid field 'payslip_id' in leaf "<osv.ExtendedLeaf: ('payslip_id', '=', 4) on hr_payslip_line (ctx: )>"


Any explanation is much appreciated.




| 5 3 6
Jakarta, Indonesia
On 11/18/14, 3:31 AM

The error indicates that payslip_id is not the field of hr_payslip_line.  Based on addons/hr_payroll/hr_payroll.py, is it possible that you should be referring to slip_id instead?

Yes, Ivan. Thanks for pointing out, it is slip_id not payslip_id. Thanks again.

Anirudh Lou
on 12/5/14, 2:38 AM

Does it work after you change to slip_id?

on 12/5/14, 3:17 AM

Yeah, it works. Thanks again :)

Anirudh Lou
on 12/19/14, 9: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: 11/17/14, 8:33 PM
Seen: 2635 times
Last updated: 3/16/15, 8:10 AM