Scaffolding Modules in Odoo 10 and Later
This article guides you through the updated scaffolding process in Odoo 10 and later versions, including how to create, customize, and install new modules. Common issues and their solutions are also covered.

Creating a new module in Odoo can be a tedious process if done manually. However, Odoo provides a scaffolding command that automates the creation of initial files and directories, streamlining the development process. In recent versions of Odoo, the command to scaffold a module has changed, causing confusion for developers who are used to the older method. This article will guide you through the updated scaffolding process and highlight common issues and their solutions.
One of the most common issues developers face is the absence of the oe script, which was previously used to scaffold modules. This script is no longer available in the latest versions of Odoo. Instead, the odoo-bin command is used, which is more versatile and aligns with the current Odoo architecture. Understanding how to use odoo-bin is crucial for modern Odoo development.
Using odoo-bin to Scaffold a Module
To scaffold a new module in Odoo 10 or later, you need to use the odoo-bin script. This script is located in the root directory of your Odoo installation. First, navigate to the directory where Odoo is installed, typically /opt/odoo or /home/odoo. Open your terminal and change the directory:
cd /opt/odoo
Once you are in the correct directory, you can create a new module using the scaffold command. The syntax for this command is:
./odoo-bin scaffold MODULE_NAME PATH_TO_STORE_YOUR_MODULE_OR_ADDONS
For example, if you want to create a module named my_new_module and store it in the ./addons/ directory, you would run:
./odoo-bin scaffold my_new_module ./addons/
This command will create a new directory my_new_module inside the ./addons/ directory, populated with the necessary initial files and directories.
Customizing the New Module
After scaffolding your module, you need to customize it to fit your requirements. The first file to edit is the __openerp__.py file, which contains metadata about your module. Open this file in a text editor:
nano ./addons/my_new_module/__openerp__.py
Here, you can set a user-friendly name for your module, add a description, and specify any dependencies. For example:
'name': 'My New Module',
'description': 'This is a new module for managing custom features.',
'depends': ['base', 'mail'],
The depends list is crucial as it ensures that your module can use functionality from other modules. In this example, the module depends on the base and mail modules.
Adding Custom Models and Methods
The next step is to add your custom models and methods. The models.py file is where you define your models. Open this file in a text editor:
nano ./addons/my_new_module/models.py
Here, you can define new models or extend existing ones. For example, to extend the mail.notification model and override the get_signature_footer method, you would add the following code:
from openerp import models, api
class FooterlessNotification(models.Model):
_inherit = 'mail.notification'
@api.model
def get_signature_footer(self, user_id, res_model=None, res_id=None, context=None, user_signature=True):
return ''
This code extends the mail.notification model and overrides its get_signature_footer method to return an empty footer. Customize this code to fit your specific needs.
Installing the Module in Odoo
Once your module is customized, you need to install it in Odoo. To do this, go to the Odoo settings and update the module list:
- Log in to your Odoo instance.
- Navigate to the Apps menu.
- Click on the Update Apps List button.
If you can't find the Update Apps List button, you may need to enable the Technical Features checkbox in your user settings. To do this, go to Settings > Users & Companies > Users, select your user, and check the Technical Features box.
After updating the module list, search for your new module. If it doesn't appear, ensure that you have removed the Applications tag from the search box filter. Once you find your module, click Install to add it to your Odoo instance.
Common Issues and Solutions
During the scaffolding and installation process, you may encounter a few common issues. Here are some solutions:
- Missing
odoo-binscript: Ensure that you are in the correct directory where Odoo is installed. Theodoo-binscript should be located in the root directory of your Odoo installation. - Module not visible in Odoo: Make sure you have updated the module list and removed the Applications tag from the search box filter. If the module still doesn't appear, check the
__openerp__.pyfile for any errors in the metadata. - Dependencies not found: Verify that all dependencies specified in the
dependslist are installed in your Odoo instance. Missing dependencies can prevent your module from being installed.
Where This Approach Does Not Fit
While the scaffolding process simplifies module creation, it may not be the best fit in all scenarios. For complex modules with many dependencies or custom requirements, manual creation and configuration might be more appropriate. Additionally, if you are working with a version of Odoo older than 10, the odoo-bin command may not be available, and you will need to use the older odoo.py script. Always verify the version of Odoo you are using and consult the official documentation for the most accurate and up-to-date information.
This article draws on Odoo - scaffolding? and answers to it (1, 2), on the Stack Exchange network, licensed under CC BY-SA 4.0.
- #customization
- #installation
- #module creation
- #odoo
- #odoo-bin
- #scaffolding



Comments