Specifying a custom directory to hold our Odoo modules

We will begin by creating a directory to hold our Odoo module. We have two options for where we can create the directory to hold our module. For our first option, we could create our directory in the addons folder where all the rest of the add-ons for Odoo are stored. This method is easy and allows Odoo to see our module simply by restarting the Odoo server.

A more preferred method, and the one we will use for this example, is to create a separate folder to hold our add-ons. This method has the advantage that we keep our modules separate from the standard Odoo modules.

Create a new directory to hold our modules by typing the following command in the Terminal:

sudo mkdir /home/mymodules

For Odoo to find this directory, we need to modify the Odoo configuration file that we looked at previously:

sudo nano /etc/odoo/odoo.conf

Here we can see a screen-shot of the configuration file:

We have edited the odoo.conf file to contain the mymodules directory within our home directory to store our custom Odoo modules.

Now we need to create a directory to hold the actual module itself:

sudo mkdir /home/mymodules/silkworm
When you are getting started, it is important that you understand how to create these required files and how they work together. Depending on the build of Odoo that you have installed, you can use scaffolding to more quickly create an Odoo application. While templating can save time, how it is used has undergone a lot of alteration, and the syntax for using it changes frequently. It is therefore recommended that you always keep yourself aware of techniques for creating an Odoo application without relying on scaffolding.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.74.160