Saturday, November 21, 2015

-C amd64 X200: Installing Odoo 8/9 using git.


Personally, I've been waiting for this little project. Remember my post earlier regarding tryton? Well, here comes the good stuff. Odoo.

I used this info to install Odoo 9, the newest version but then after opening the web, the display is all over the places. Text overlapping and the sections not displayed correctly. So I used this same method and install Odoo 8, which only shown a one-time "JQuery outdated" version warning but doesn't ruin the experience.

What I'm trying to do is:
-Install Odoo 8 (Odoo 9 should be no different) - done
-Use Httpd to serve the web - not yet
-Autostart Odoo 8 after boot - not yet

I'm using this sites for references, which is great help.

Take note that this installation is supposed to be for Odoo 9, but after few showstopper, I downloaded Odoo 8 and run on-top of this method, which has no bad effect. Yet.

First, install all required programs.
Install git
$ su root -c 'pkg_add git'

Install Python 2.7

Install py-pip, then use pip to install setuptools and then upgrade it. It's because I had "egg_info" error in Odoo 9 if I didn't upgrade it. Then install python-ldap, as the python-ldap listed in Odoo's requirement.txt cannot be installed (more on this later). Then also I need to install py-psutil using pkg_add, instead of pip because I got "platform openbsd5 not supported" when installing. Then I upgrade psutil using pip.
$ su root -c 'pkg_add py-pip'
$ doas pip install --upgrade pip
$ doas pip install setuptools
$ doad pip install --upgrade setuptools
$ doas pip install python-ldap
$ su root -c 'pkg_add psutil'
$ pip install --upgrade psutil

Install NodeJS. In OpenBSD it's called node. First install node using pkg_add, then upgrade it using npm, then using npm to install less and less-plugin-clean-css and upgrading 'em.
$ su root -c 'pkg_add node'
$ doas npm install -g npm
$ doas npm install less
$ doas npm install -g less
$ doas npm install less-plugin-clean-css
$ doas npm install -g less-plugin-clean-css

Install PostgreSQL

Install this optional programs, in my system half of it has already been installed.:

Setting up Odoo 8 and PostgreSQL database for it.

Ok, for PostgreSQL, I just create a superuser named "odoo" which will require password.
$ createuser -U postgres -P -s odoo

Then I need to insert password for that new user.

Using Git, I download the latest Odoo 8.0 branch. I'm putting this in my home directory.
$ cd ~
$ git clone --depth 1 --branch 8.0

Yes, it's 2 "odoo" folder. Wait for it to finish downloading. After that you can see an "odoo" directory inside. Then go inside that directory.
$ cd odoo

Then I need to use pip to install the dependencies needed for Odoo 8.
$ doas pip install -r requirements.txt

This is when I have problem on psutil which gave "platform openbsd5 not supported" error, that's the reason I installed it above via pkg_add (not sure if odoo will use this other version.)

Then also I got an error about python-ldap cannot be installed. That's also the reason I installed python-ldap using pip manually. So, to make sure that the installation advances, I deleted those 2 requirement from the.. err.. requirement.txt.

In Odoo 9's requirement.txt:

In Odoo 8's requirement.txt:

Then run again the pip installer:
$ doas pip install -r requirement.txt

It's done! Now to create the configuration file. I created ".openerp-serverrc" file inside my home directory.
$ vi ~/.openerp-serverrc

--------- ~/.openerp-serverrc start ---------
db_host =
db_port = 5432
db_user = odoo
db_password = mypass
addons_path = /home/myhome/odoo/addons
--------- ~/.openerp-serverrc ends ---------

Done. Now I need to run the server and then configure Odoo via web.
$ cd ~/odoo
$ ./ &

In that same terminal, I can see all the info on what Odoo is currently doing. Then, in browser, open or http://localhost:8069.

This screenshot is for Odoo 9. For Odoo 8, the page is different but the input required is the same. In Odoo 9, after database creation, my Odoo homepage is chaos. Like I've said earlier, text overlapping, display corruption etc. And then there's 'Could not execute command 'lessc' on the top-left side.  I read that I need to update less and less-plugin-clean-css via npm.

$ doas npm install -g less
$ doas npm install -g less-plugin-clean-css

Then I drop the database by using this page:

Delete the database, then go to the start page to create new. Still the same issue. So then I download Odoo 8.0 branch instead (this method above is for Odoo 8.0 branch).

In Odoo 8, when I open the start page for the first time, there's error about JQuery version being old version, but still can load Database Manager page. After creating database, the page doesn't refresh to load the main page. I need to see the term I run ./openerp-server and see if it's idling. After that I open up the home page.

As you can see, there's the warning message. It doesn't cripple the site, AFAIK but I'm looking into this later. Currently I've installed the accounting module and all seems to be working fine.

Update 26/11/2015:
Good news. Odoo 9.0 is working now. The "lessc" issue has been resolved. What I did was update the NodeJs's npm and then less and less-plugin-clean-css

$ doas npm install -g npm
$ doas npm install -g less less-plugin-clean-css

Then I started my Odoo 9. It's working! I'm not sure why the initial npm update above is not working. Anyway, it's good to know that it's working now.

ToDo: Set up httpd for Odoo 8
ToDo: Set up Odoo 8 in rc.d for automatic boot and shutdown.

p/s: I changed the Administrator's profile and when I tried to open back the home page, I was asked to enter email and password. I tried everything and can't log in. But then I didn't try this:

Email: admin
Password: my_odoo's_PgSQL's_password

And then only I can log in. Later.

No comments: