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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
4
Replies
15494
Tampilan
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
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
0
Jul 25
|
263 | ||
|
1
Jul 25
|
5036 | ||
|
0
Jul 25
|
593 | ||
|
0
Jun 25
|
680 | ||
How to use multi label switching interface in Odoo
Diselesaikan
|
|
1
Jun 25
|
857 |