コンテンツへスキップ
メニュー
この質問にフラグが付けられました
4 返信
15529 ビュー

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
290
1
7月 25
5066
0
7月 25
628
0
6月 25
694
1
6月 25
867