1
votes

I have been struggling with Odoo ever since the start. This is probably one of the worst documented pieces of software in the world. I tried asking this on their forums but you are not allowed to post until you have x amount of Karma which you seem to only get when purchasing courses via them.

I have followed the installation tutorial for the source for Ubuntu via https://www.odoo.com/documentation/13.0/setup/install.html#id7 to the T.

I managed to start the clean vanilla version and get into the superuser mode, which by the way, was also hidden like crazy on how to enable it. Then going to the actual settings requires you to install at least one app. This makes absolutely no sense to me.

Anyway, I end up getting to the point where I found how to do those above basic things. Now I want to create a custom module following your very own tutorial: https://www.odoo.com/documentation/13.0/howtos/backend.html#.

I use the scaffold command to initiate the quick creation of a module. So far so good. But when I actually want to get it loaded into Odoo, everything seems to fall apart. I have searched for hours and I end up with the same instructions on various sources: Go to apps > Update Apps List and refresh. NOTHING happens. Absolutely NOTHING. I remove any filter and search for the name of the custom module but it is not there.

I am completely empty and am entirely stuck. The lack of documentation and the few documentation that can be found seems to not even work properly.

So before I give up on Odoo forever: How can I create a module and add it to Odoo?!

And before you ask I have tried literally everything I can think of:

-started from scratch and a clean installation well over 5 times

-I even completely ERASED UBUNTU and restarted from scratch

-I have tried to scaffold, reboot Odoo, add it manually, amend the route of the addons to the config, created my custome module in a different dir, named it differently, filled in the manifest, absolutely NOTHING works.

I will greatly appreciate if anyone can help me here but I do not have high hopes. I am at the end of my latin and patience when it comes down to Odoo.

2
Give us what you have this far. If your module isn't listed in Odoos app listing after updating module list most likely you have some problems with your __manifest__.py -file or your module isn't in your addons path.ex4
And I've been running Odoo and it's predecessor OpenERP since version 5 in enterprise usage more than a decade now. Both community and commercial versions. It's very flexible system. And it has very good module API once you get used to it. Just don't give up yet :)ex4
And one more comment. Module template that scaffold method create is quite complex. It might be even easier to create your "hello world" module from scratch. You need five files just a few lines of code in each: __manifest__.py, __init__.py, models/yourmodule.py, models/__init__.py and views/yourview.xml. That scaffold creates controllers directory and other stuff you usually don't need. Depending what you are doing of course.ex4
Please restart Odoo and edit you question with the recent log. Try to check permissions, the module will not be listed in the module list if the user running Odoo does not have permission to access the module directory.Kenly

2 Answers

2
votes

1) Download a free module from odoo store (to be sure there's no problem with the custom module)

2) Copy the folder that contains the manifest file to addons folder which is defined in the .conf file

3) Go to settings and activate developer mode (you must be administrator)

4) Go to apps and after activating developer mode you can update apps list (top left fourth button)

5) Now just search for you module and install it

1
votes

Odoo installations process may vary, it depends on if you decide to use git, or for example apt packages.

Part 1) I've installed Odoo 13 in an Ubuntu Server 20 in this way:

sudo apt update
sudo apt upgrade
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo apt install ./wkhtmltox_0.12.5-1.bionic_amd64.deb
wget -O - https://nightly.odoo.com/odoo.key | sudo apt-key add -

echo "deb http://nightly.odoo.com/13.0/nightly/deb/ ./" | sudo tee /etc/apt/sources.list.d/odoo.list

sudo apt update
sudo apt install odoo

sudo service odoo status
sudo systemctl enable --now odoo

(in this way odoo process can start autonomously)

Part 2) Configuration file of Odoo is here:

sudo nano /etc/odoo/odoo.conf

When you see the log of Odoo running, in this way, for example:

sudo tail -f  /var/log/odoo/odoo-server.log

You can see what are the directories that are being used, in this case the log reports:

[...] INFO ? odoo: addons paths: ['/usr/lib/python3/dist-packages/odoo/addons', '/var/lib/odoo/.local/share/Odoo/addons/13.0'] 

By default Odoo server takes the default addons from dist-packages directory. The other paths are decided by you, but keep in mind the importance of The permissions of the folders.

[ Inside Odoo conf:]

;addons_path = /usr/lib/python3/dist-packages/odoo/addons
addons_path = /var/lib/odoo/.local/share/Odoo/addons/13.0

Part 3) The permissions of the folders

Now, compare the "permission number" of addons folder of the default directory, with the addons that you've add. if you go in /usr/lib/python3/dist-packages/odoo and you write:

stat -c %a addons/

You can see the permissions, in this case 755

if you write: ls -lath you can also see the owner informations of the addons folder, in this case root:root enter image description here

Now, compare these informations with the other addons folder, the one in the path:

/var/lib/odoo/.local/share/Odoo/

If you have any differences, you can adjust by using the commands:

sudo chown -R root:root  /var/lib/odoo/.local/share/Odoo/

Notice: it depends on the users you have in your machine and the user that have the priviledges to start the Odoo service.

sudo service odoo restart

Also, when I was changing the permissions in the folders, I've noticed in the log a "Permission denied" error

PermissionError: [Errno 13] Permission denied: '/var/lib/odoo/.local/share/Odoo/sessions/xxxx' 

So, it is also important to have the correct rights in those folders that are use by Odoo that are:

  • addons
  • sessions
  • filestore

enter image description here

Part 4) Test a folder of addons, pay attentions of addons grouped

I've tested this configuration buy doing a git checkout of one OCA addons with this simple script that I run inside: /var/lib/odoo/.local/share/Odoo/addons/13.0

mkdir account-analytic
cd account-analytic
git init
git remote add origin https://github.com/OCA/account-analytic.git
git pull origin 13.0

And I've realized that the module account-analytic, since is a GROUP of modules, does not work as I expected. Inside account-analytic there are these modules:

  • account_analytic_parent analytic_base_department account_analytic_required analytic_tag_dimension mrp_analytic oca_dependencies.txt procurement_mto_analytic product_analytic purchase_analytic setup stock_analytic

enter image description here

so, If I search for example: analytic_base_department

enter image description here

Nothing is found, but If I move the module outside the group, in one path ahead, and I restart the server and Update the list of the App, then the magic happens:

sudo mv analytic_base_department ../
sudo service odoo restart

enter image description here

The same happens with your custom module if it respect the hyrarchy suggested when you build a module: manifest, view, module, controllers etc etc.

Remember that one of the hidden problems of Odoo are to understand the folder permissions for the service and implement them well.