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.
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
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 10/8/14, 4:04 AM|
|Seen: 662 times|
|Last updated: 3/16/15, 8:10 AM|