Odoo Help

1

Openerp handling of submodules?

By
Carlos Llamacho
on 9/11/13, 6:52 PM 1,999 views

Can i have a package configuration like a regular python module in OpenERP?

Something like this.

main_module/
     __init__.py
     __openerp__.py
     module.py
     sub/
            __init__.py
            sub_module.py
            sub_module2.py

I understand that in python this would allow me to call from module.submodule import * or via import module.sub_module right? What would be the configuration of the __init__.py files to achieve this? Thanks in advance.

1
Daniel Reis
On 9/11/13, 7:31 PM

Yes, an OpenERP module is basically python code and like a python module. You can see examples of this in the standard modules: notice that many have subdirectories such as wizard or report with an __init__.py and additional python files.

So if wanted to create a model inside a subfolder, how would i need to call it from the __init__.py in the main folder, import submodule or from module.submodule import * (Does this way even works in openerp modules?)

Carlos Llamacho
on 9/12/13, 11:30 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 9/11/13, 6:52 PM
Seen: 1999 times
Last updated: 3/16/15, 8:10 AM