Skip to Content
Menu
This question has been flagged
4 Replies
15631 Zobrazenia

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?

Avatar
Zrušiť
Best Answer

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

Avatar
Zrušiť
Autor

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 Replies Zobrazenia Aktivita
0
júl 25
458
1
júl 25
5479
0
júl 25
1024
0
jún 25
1009
1
jún 25
1118