Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4 Відповіді
15510 Переглядів

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

Related Posts Відповіді Переглядів Дія
0
лип. 25
266
1
лип. 25
5038
0
лип. 25
599
0
черв. 25
683
1
черв. 25
857