Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
277 มุมมอง

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

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

Thanks.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 25
1443
0
ม.ค. 25
3576
1
ส.ค. 23
14930
change password แก้ไขแล้ว
1
ส.ค. 23
13595
1
ก.ค. 23
10572