Ir al contenido
Menú
Se marcó esta pregunta
186 Vistas

Hi everybody!!!

Please i want to know how to get the id of an element of a class.

Here is my function:


def get_inputs(self, cr, uid,ids, state, project, context=None):

ret = []

print ('--------------------get_inputs---------------------')

print (project)

if project == []:

return False

else:

obj = self.pool.get('project_service')

obj_ids = obj.search(cr, uid, [], context=context)

res = obj.read(cr, uid, obj_ids, ['id', 'int_service','ext_service','unit_service','int_service_unit','ext_service_unit','service_type','service_id'], context)

for r in res :

inputs = {

'project_service_id': r['id'],

'project_id' : project,

'int_services': r['int_service'],

'ext_services': r['ext_service'],

'unit_services': r['unit_service'],

'int_services_unit': r['int_service_unit'],

'ext_services_unit': r['ext_service_unit'],

'service_type': r['service_type'],

'service_idd': r['service_id'],

}

ret += [inputs]

return ret

I want to get the id of project which is an attribute in an other class

Please help

Thanks in advance

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
mar 25
1361
0
ene 25
3451
1
ago 23
14777
1
ago 23
13431
1
jul 23
10410