Professional Documents
Culture Documents
Odoo 1
Odoo 1
1. Create a new module by running the following command in your Odoo development environment:
```
```
2. Open the `__manifest__.py` file in your module directory and add the following code to define your
module:
```python
'version': '1.0',
'description': """
""",
'category': 'Tools',
'depends': ['base'],
'data': [
'views/my_menu.xml',
],
'installable': True,
}
```
3. Create a new file called `my_menu.xml` in your module's `views` directory and add the following code
to define your sub menu:
```xml
<odoo>
<data>
<field name="res_model">my_module.my_model</field>
<field name="view_mode">tree,form</field>
</record>
</data>
</odoo>
```
4. In this example, we have created a sub-menu called "My Sub Menu" under the main menu "My
Module". We have also defined an action for the sub-menu that will open a tree and form view of a
model called `my_module.my_model`.
5. Finally, install your module by restarting Odoo and going to the Apps menu. Find your module and
click the "Install" button.
6. Once installed, you should see your new sub-menu in the main menu of Odoo. Clicking on it should
open the view defined in the `my_menu.xml` file.