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

I am having a button in product form. And on click, perform an action based on javascript. But to do that action I need to get the current product id in the js file. How can I get the id in js file?

아바타
취소
베스트 답변

Hi Akhill:

In your .py method just call self._id to get the current id.

In js just call this.id to get the current id

아바타
취소
작성자

Am not getting right after giving "this.id" in js file. In js file what does "this" represents? After looking in some usages in odoo js files, its the current page or widget you are working na?

in js, this.id represents the current recodr id

관련 게시물 답글 화면 활동
0
7월 25
284
1
7월 25
5052
0
7월 25
612
0
6월 25
694
1
6월 25
863