Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
128 Prikazi

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

Avatar
Opusti
Best Answer

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']}

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
mar. 25
1279
0
jan. 25
3360
1
avg. 23
14652
1
avg. 23
13297
1
jul. 23
10301