I recently wrote a tutorial on How to install Odoo 11 on Ubuntu 18.04 and I just started the Odoo module development. I was looking at the Odoo’s official documentation and nothing was working for me, even the very first command i.e `odoo-bin` . Either the documentation is out of date or I am too stupid to understand it. Anyway in this blog post I am going to show how I setup my Odoo development environment on Ubuntu 18.04
As the official documentation suggest using odoo-bin
, there’s not only that command available but also there’s no such file as odoo in /opt directory. So we are going to make our module in the directly of our choice, I made a directory with name odoo in my ~/Document
:
$ cd Document
$ mkdir odoo
$ cd odoo
Now we are going to create our module in this directory, but instead of using odoo-bin
we will simply use the odoo
command. Odoo has an option scaffold
which will help us set up our files, directories and sub-directories for our module.
$ odoo scaffold helloworld addons
(it will create `helloworld` in `addons` directory, the second directory name can be ommited)
It will take only a second to setup a boilerplate for our own module, in this case our ‘helloworld’ module. As everything is set up, we only have to add our custom module path to the odoo configuration. By default the odoo config file is in ‘/etc/odoo/odoo.conf’ which looks like this
1 [options]
2 ; This is the password that allows database operations:
3 ; admin_passwd = admin
4 db_host = False
5 db_post = False
6 db_user = odoo
7 db_password = False
8 addons_path = /usr/lib/python3/dist-packages/odoo/addons
You can add your custom modules path in that one line separated by a comma like:
1 [options]
2 ; This is the password that allows database operations:
3 ; admin_passwd = admin
4 db_host = False
5 db_post = False
6 db_user = odoo
7 db_password = False
8 addons_path = /usr/lib/python3/dist-packages/odoo/addons, /home/elliot/Documents/odoo/addons
What I like to do is create a separate config file in my custom module directory with the same content (because I don’t want to mess with the default configuration files) and then fire up odoo with the option `--config` in that custom module directory. e.g `odoo start --config=odoo.conf -i helloworld
`
Go to the browser and http://localhost:8069 and then navigate to Settings on top, on the right side you should see a panel ‘Share the love’ , ‘Activate the developer mode’
After activating the developer mode, navigate to ‘Apps’ , On the left sidebar ‘Update Apps List’
Search for your custom module from the top search bar, in my case which is ‘Hello World’ and tada:
Brother , I don’t know much about computers but why have you written “started” twice in the beginning?
LikeLiked by 1 person
My firefox Gramarly extension was probably sleeping while I was writing this post =] Thank You for pointing it out!
LikeLike