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
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
4
Trả lời
15502
Lượt xem
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
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 7 25
|
263 | ||
|
1
thg 7 25
|
5036 | ||
|
0
thg 7 25
|
594 | ||
|
0
thg 6 25
|
681 | ||
|
1
thg 6 25
|
857 |