Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
314 Tampilan

Hi guys!!!!

Please i want to write in the field with the obj_ids (id)credit the value res[0]['credit'].

obj.write([obj_ids], {'credit': res[0]['credit']})

But i got this error:

TypeError: old_api() takes at least 4 arguments (3 given)

Help please

Avatar
Buang
Jawaban Terbai

Do obj.write({'credit': res[0]['credit']}) !

Make sure your obj is pointing to self pointer which is the browse()!

Thanks.

Avatar
Buang
Jawaban Terbai

Hi,

In old api we need to pass (cr, uid, ids, vals) this 4 arguments inside write() method.

But here you have only pass (ids, vals). You also need to give as like below.

obj.write(cr, uid, [obj_ids], {'credit': res[0]['credit']} ) # if obj_ids is not an list object. otherwise just put obj_ids without [ ].


If you want to use new api and your "obj" variable is browsable object then just make calling as like

obj.write( {'credit': res[0]['credit']} )


Hope it will resolve your issue.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Mar 25
1462
0
Jan 25
3603
1
Agu 23
14959
change password Diselesaikan
1
Agu 23
13616
1
Jul 23
10600