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

Hi, I've been trying to call the python method from the web client. The method is

action_invoice(self, cr, uid, ids, context=None):

In javascript, I call this method via

var model = new instance.web.Model("pos.order");

model.call("action_invoice", [], {context: new instance.web.CompoundContext()});

But it doesn't work. The error says that I lack one argument in the call. I think what I miss is the arguments "ids". From googling, it seems to be a list of record ids. What is it anyway ? Could you please tell me what is it and how to store that argument it in the javascript ?

Thank you very much

아바타
취소

argument "ids" is the record id or list of records ids. In the method call pass "ids" record id value. so that method is executed for the particular record id.

베스트 답변

You need to pass a list of ids containing those pos.order ids of which action_invoice you wish to call.

For example if you want to call action_invoice on pos.order with id of 1:

var model = new.istance.web.Model("pos.order");

model.call("action_invoice",[[1]]);

In the above example, first brackets after the method name contain arguments you wish to pass, inner brackets are for the list of ids.

아바타
취소
관련 게시물 답글 화면 활동
2
11월 24
3962
1
6월 23
2161
1
5월 23
2098
1
10월 22
4262
0
5월 20
3262