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

my function is defined in the website controller and I wish to call it from a model, e.g (res.partner) 

الصورة الرمزية
إهمال
أفضل إجابة

You can do this by:

Importing the controller into the model and then you can call the function from the controller. for eg:

from odoo.addons.module_name.controllers.main import class_name_of_the_controller.
Thank you.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يوليو 24
2097
1
أغسطس 15
3531
2
ديسمبر 21
23951
4
أكتوبر 21
37047
1
يوليو 21
3872