python - How to arrange files in Odoo -




beginner odoo questions. how arrange model files , controller files in respective folders? , have write in init.py file?

currently have models , controllers in root folder of module.

like this

addons\ -->mymodule\    -->views\       -->view.xml    -->__init__.py    -->__openerp__.py    -->models.py    -->controllers.py 

i have tried

addons\ -->models\    -->models.py 

and import models.py using inside init.py

from models import models 

but not work

addons\    ->yourmodule\       ->controllers\          ->__init__.py          ->controllers.py       ->models\          ->__init__.py          ->modelname.py       ->__init__.py       ->__openerp__.py 

content of init.py in controllers folder:

from . import controllers 

content of controllers.py in controllers folder:

from openerp import http 

content of init.py in models folder:

from . import modelname 

content of init.py in module folder:

from . import controllers . import models 

content of openerp.py in module folder: list of xml files (instruction)





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -