Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4230 Lượt xem

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?

 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
Doubt about module Đã xử lý
2
thg 5 22
1471
2
thg 10 23
3607
1
thg 10 23
2964
1
thg 4 23
2281
1
thg 12 22
2424