Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
4 Respostas
15543 Visualizações

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
Cancelar
Melhor resposta

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
Cancelar
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

Publicações relacionadas Respostas Visualizações Atividade
0
jul. 25
312
1
jul. 25
5096
0
jul. 25
665
0
jun. 25
723
1
jun. 25
897