Any one can help? In class "hr.employee" there is a one2many fields for "hr.payslip" w/c in turn has one2many fields for "hr.payslip.line". My problem is whenever i output employee's payslips it return nothing but my database is populated.
Here is the chunk of my code:
for emp in self.pool.get('hr.employee').browse(cr,uid,emp_ids,context=context):
pay_ids = self.pool.get('hr.payslip').search(cr,uid,[('employee_id','=',emp.id)],context=context)
netsvc.Logger().notifyChannel("OUT PUT ", netsvc.LOG_INFO, 'EMP LIST ....' + str(emp_ids))
netsvc.Logger().notifyChannel("OUT PUT ", netsvc.LOG_INFO, 'PAYSLIP :::::' + str(pay_ids))
*** pay_ids shows nothing but an empty list ***
anyone can help?
Are you sure emp_ids is not an empty list?
Furthermore, what is the result when you approach from the other way around, i.e. browse over all the hr.payslip records with no domain? Do you get any result?
pay_slip_obj = self.pool.get('hr.payslip')
pay_ids = pay_slip_obj.search(cr, uid, )
for rec in pay_slip_obj.browse(cr, uid, pay_ids):
print "Rec emp ==> ", rec.employee_id.id
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
|Asked: 10/8/14, 4:04 AM|
|Seen: 518 times|
|Last updated: 3/16/15, 8:10 AM|