O'Reilly logo

Odoo Development Cookbook by Daniel Reis, Alexandre Fayolle, Holger Brunn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Organizing the addon module file structure

An addon module contains code files and other assets such as XML files and images. For most of these files, we are free to choose where to place them inside the module directory.

However, Odoo uses some conventions on the module structure, so it is advisable to follow them.

Getting ready

We are expected to have an addon module directory with only the __init__.py and __openerp__.py files.

How to do it…

To create the basic skeleton for the addon module:

  1. Create the directories for code files:
    $ cd path/to/my-module
    $ mkdir models
    $ touch models/__init__.py
    $ mkdir controllers
    $ touch controllers/__init__.py
    $ mkdir views
    $ mkdir security
    $ mkdir data
    $ mkdir demo
    $ mkdir i18n
    $ mkdir -p static/description
    
  2. Edit ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required