تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
3676 أدوات العرض

Hello everybody;

I have a python function that i need to call from a js file.

But need your help to know how it works with jqwery.

Thanks a lot in advance.

Best regards.

الصورة الرمزية
إهمال

Do you mean to call a controller function from the JS file?

أفضل إجابة

Yes, you can do it using controller in javascript.

Make an rpc call as below inside controller:

self._rpc({
model: <your_model_name>,
method: '<your_method_name>',
args: [data[key]],
context: session.user_context,
}).done(function() {}).fail(function() {})
الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
سبتمبر 24
14373
0
أبريل 18
2464
1
يوليو 19
6411
2
يوليو 24
2423
1
يونيو 24
4938