Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
3139 Ansichten

Hello everybody!!!

Please can anyone help me know how to make a search on a many2one field.

Here is my code:

 obj_contract = self.pool.get('hr.contract')

for emp in self.browse(cr, uid, ids, context=context):

contract_ids = obj_contract.search(cr, uid, [('employee_id', '=', emp.id)], order='date_start', context=context)

if contract_ids:

vals = obj_contract.read(cr,uid,contract_ids,['department_id'],context=context)

print contract_ids

print vals[0]['department_id']

if vals:

obj_department = self.pool.get('hr.department')

department_ids = obj_department.search(cr, uid, [('id', '=', vals[0]['department_id'])], order='id', context=context)


Thanks a lot in advance.

Best Regards.

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
März 15
3690
3
Feb. 25
35634
2
Feb. 25
8704
1
Sept. 24
2352
3
Juli 24
24756