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

I have some python functions(send_otp, verify_otp) in a custom module called "authenticator"

I want to use/call that functions in another custom module "mypos".

I want to call the sent_otp() function from mypos module.

Can I do this in odoo?

 

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

Assuming that these functions are not of any Models. Let us assume that inside the "authenticator" module there is a folder called "tools" and inside it a python file called "functions.py" with functions(send_otp, verify_otp).

if you want to use these functions in any other module,:-

First, include the "authenticator" module in depends inside the manifest file.

And import these functions in the needed python file like:-

from odoo.addons.authenticator.tools.functions import send_otp,verify_otp
الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
Doubt about module تم الحل
2
مايو 22
1671
2
أكتوبر 23
3773
1
أكتوبر 23
3087
1
أبريل 23
2415
1
ديسمبر 22
2580