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:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
4
الردود
15266
أدوات العرض
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
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
1
مايو 25
|
618 | ||
|
0
مارس 25
|
324 | ||
|
1
ديسمبر 24
|
2672 | ||
|
2
نوفمبر 24
|
1004 | ||
|
1
أكتوبر 24
|
1640 |