跳至內容
選單
此問題已被標幟
1 回覆
18828 瀏覽次數

Hi

There is a custom_addons folder and there is no __init__.py file in it. There are two separate modules, lets say - module_one and module_two . In module_one there is a py file which I need in module_two to get a declared global variable.

Now when I write:

from odoo.addons.module_one import model

It shows error and doesn't find the module, because the module_one isn't in addons folder. I can't add __init__.py in the custom addons folder due to some restrictions. 

How can I get the custom modules py file in another custom module?

Thanks

頭像
捨棄
作者 最佳答案

It worked with: 

from odoo.addons.custom_addon_name.models.py_file_name import IMPORT_LIST

It looks like IDE was conning with me.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
7
12月 23
26819
1
3月 15
9965
2
10月 23
3983
1
1月 23
6236
0
9月 17
5286