Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
127 Vizualizări

Hello everybody!!!

Please i want to change res[0]['credit_service'] with  res2[0]['money'] in my database but i didnt know how.

I have tried this but it doesnt work

obj = self.pool.get('project.service.line')

obj_ids = obj.search(cr, uid, [('project_id', '=', res[0]['project'])])

res = obj.read(cr, uid, obj_ids, ['credit_service'], context)

print res

print res[0]['credit_service']

res[0]['credit_service'] = res2[0]['money']

print res[0]['credit_service']

return res[0]['credit_service']

Any idea please

Imagine profil
Abandonează
Cel mai bun răspuns

you have to use self.write or self.pool.get('project.service.line').write

in your case, you have to self.write(cr, uid, obj_ids, {'credit_service':res2[0]['money']}

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
mar. 25
1279
0
ian. 25
3360
1
aug. 23
14651
1
aug. 23
13296
1
iul. 23
10301