Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
4508 Weergaven

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?

 

Avatar
Annuleer
Beste antwoord

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
Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
mei 22
1689
2
okt. 23
3802
1
okt. 23
3138
1
apr. 23
2464
1
dec. 22
2612