콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
270 화면

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.

아바타
취소
관련 게시물 답글 화면 활동
0
3월 25
1442
0
1월 25
3574
1
8월 23
14926
change password 해결 완료
1
8월 23
13593
1
7월 23
10571