Howto install Odoo 10

Hi ppl,

this howto is about installing Odoo 10, a CRM and ERP suite.

EDIT - 11.1.2018

  • added optional HTTPS with nginx - thanks to @dnutan and @Clinton_McDonald
  • added AD user configuration - thanks to @iglqut

EDIT - 16.12.2017

  • changed db template because postgresql doesn’t accept UTF8 without template anymore - thanks to @danb35
  • optimized yum install by installing just 2 packages - thanks to @danb35

EDIT - 8.12.2017

  • added quick copy/paste install
  • added application button

EDIT - 6.12.2017

  • yum install nethserver-postgresql instead of postgresql-server - thanks to @dnutan
  • yum install pyparsing - Failed dependencies: pyparsing is needed by odoo-10.0.post20171205-1.noarch

Quick copy/paste install without HTTPS

If you just want odoo to go then copy/paste the following to a text editor, change the SECRET password and copy/paste to your terminal and you are ready.
For a step by step howto go to next step, recommended to know what you do :slight_smile:

yum -y install nethserver-postgresql http://nightly.odoocdn.com/10.0/nightly/rpm/odoo_10.0.latest.noarch.rpm
systemctl enable --now postgresql
su - postgres
psql
CREATE ROLE odoo WITH LOGIN password 'SECRET';
CREATE DATABASE odoo ENCODING 'UTF8' OWNER odoo TEMPLATE template0;
\q
exit
config set fw_odoo service status enabled TCPPort 8069 access green
signal-event firewall-adjust
cat > /etc/odoo/odoo.conf << EOL
[options]
; This is the password that allows database operations:
;admin_passwd = admin
db_host = localhost
db_port = 5432
db_user = odoo
db_password = SECRET
addons_path = /usr/lib/python2.7/site-packages/odoo/addons
EOL
systemctl enable odoo
systemctl start odoo
cat > /usr/share/nethesis/NethServer/Module/Dashboard/Applications/Odoo.php << EOL
<?php
namespace NethServer\Module\Dashboard\Applications;
class Odoo extends \Nethgui\Module\AbstractModule implements \NethServer\Module\Dashboard\Interfaces\ApplicationInterface
{
  public function getName()
  {
    return "Odoo";
  }
  public function getInfo()
  {
    \$host = explode(':',\$_SERVER['HTTP_HOST']);
    return array(
      'url' => "http://".\$host[0].":8069",
    );
  }
}
EOL

Installing odoo and dependencies

yum -y install nethserver-postgresql http://nightly.odoocdn.com/10.0/nightly/rpm/odoo_10.0.latest.noarch.rpm
systemctl enable --now postgresql

Database

You may use phppgadmin or command line to create a role with password, database and rights on the database:

su - postgres
psql
CREATE ROLE odoo WITH LOGIN password 'SECRET';
CREATE DATABASE odoo ENCODING 'UTF8' OWNER odoo TEMPLATE template0;
\q
exit

Firewall

Add network service for odoo with TCP Port 8069 on green interface:

config set fw_odoo service status enabled TCPPort 8069 access green
signal-event firewall-adjust

Configuration

Edit /etc/odoo/odoo.conf and enter Odoo postgresql db user credentials:

[options]
; This is the password that allows database operations:
;admin_passwd = admin
db_host = localhost
db_port = 5432
db_user = odoo
db_password = SECRET
addons_path = /usr/lib/python2.7/site-packages/odoo/addons

I needed to install a specific version of psutil because I had following error in /var/log/messages, but maybe just because my system is a heavy penetrated test system, thanks to @dnutan
Normally you do not have to do this:

Sep 11 18:57:21 server odoo: ImportError: version conflict: '/usr/lib64/python2.7/site-packages/psutil/_psutil_linux.so' C extension module was built for another version of psutil (different than 2.2.1)

If you really have this kind of error just install psutil 2.2.1 via pip:

pip install psutil==2.2.1

Enabling service and login

systemctl enable odoo
systemctl start odoo

Application Button

Create the file /usr/share/nethesis/NethServer/Module/Dashboard/Applications/Odoo.php:

cat > /usr/share/nethesis/NethServer/Module/Dashboard/Applications/Odoo.php << EOL
<?php
namespace NethServer\Module\Dashboard\Applications;
class Odoo extends \Nethgui\Module\AbstractModule implements \NethServer\Module\Dashboard\Interfaces\ApplicationInterface
{
  public function getName()
  {
    return "Odoo";
  }
  public function getInfo()
  {
    \$host = explode(':',\$_SERVER['HTTP_HOST']);
    return array(
      'url' => "http://".\$host[0].":8069",
    );
  }
}
EOL

HTTPS - optional - may make some applications unavailable

Warning! This is only recommended if you really need HTTPS as odoo will work but other apps won’t!

I could only setup HTTPS with nginx and moving apache ports to 81 and 10443 which may lead to some applications not working anymore.

# Stop httpd
systemctl stop httpd

# change port from 80 to 81
sed -i 's/^ /Listen 80/Listen 81' /etc/httpd/conf/httpd.conf

# change port from 443 to 10443
sed -i 's/^ /Listen 443 https/Listen 10443 https' /etc/httpd/conf.d/ssl.conf

# Install nginx
yum -y install nginx

# deactivate default server on port 80
sed -i '38,57 s/^ /# /' /etc/nginx/nginx.conf

Enable proxy mode in /etc/odoo/odoo.conf and use the following /etc/nginx/conf.d/odoo.conf for nginx as described here: https://www.odoo.com/documentation/10.0/setup/deploy.html#id7

Edit /etc/nginx/conf.d/odoo.conf and change the used certificate to

ssl_certificate /etc/pki/tls/certs/localhost.crt;
ssl_certificate_key /etc/pki/tls/private/localhost.key;
# start and enable services
systemctl restart odoo
systemctl start httpd
systemctl enable nginx
systemctl restart nginx

Browse to your odoo site

Browse to http://YOURNETHSERVER:8069 or, if you enabled HTTPS, to https://YOURNETHSERVER

This screen is only shown, if you have no database, so odoo provides creating one.
Uncheck demo data when you want to have an empty odoo. I checked it, because it’s better for evaluating.
Enter creds for the admin user and click “Create Database”…
If you don’t see this screen, the login is admin/admin, thanks again to @dnutan

Welcome to paradise!

AD config

This works only if you have at least nethserver-sssd 1.3.5-1 installed.

Install the LDAP module via Apps menu

Setup the LDAP module via Settings/General Settings and add LDAP Parameters:

You may just enter the ldap binddn / password from your account settings in Nethgui:

grafik

The LDAP base can be found in “Domain Accounts” in Nethgui, usually something like “dc=AD,dc=DOMAIN,dc=LOCAL”

It is recommended to create a template user in odoo, set rights and roles, don’t set a password and use this user as template user so newly created odoo users out of NS AD users will use this template.

I am excitedly awaiting your feedback!

Sources:
http://www.nevprobusinesssolutions.com/active-directoryad-authentication-odoo/
https://www.odoo.com/documentation/10.0/setup/install.html

10 Likes

Looks pretty and powerful, is there a community version that gives access to all the apps free? Otherwise, Odoo can get real expensive, real quick.

1 Like

This is the community version and I tried to install some apps and it just worked.
Here is a comparison, not all apps are available in community version:

1 Like
  • Small typo in db_user = ogoo. And in yum install postgresql-server, there’s an extra comma (,)

  • Had to enable and start postgresql service systemctl enable --now postgresql (note: there’s a nethserver-postgresql package available that could be used instead)

  • asked for additional dependencies:

error: Failed dependencies:
python-docutils is needed by odoo-10.0_20170911-1.noarch
python-ldap is needed by odoo-10.0_20170911-1.noarch
python-yaml is needed by odoo-10.0_20170911-1.noarch

yum install python-{docutils,ldap,yaml}
  • Didn’t complain about psutil; some previous and unrelated updates brought the correct version:
  • Can access with http (as per you guide), but cannot access with https:
    • odoo log reports: code 400, message Bad HTTP/0.9 request type and code 400, message Bad request syntax ('\x16\x03\x01\x00\xa3\x01\x00\x00\x9f\x03\x03,SB\x88\x8a\x011\xfa\xc6\xbb\xefhy\x89\xad\xdbJ\x1d\xb5\xed3_\xec\x9e\xdc\x91\xe5\xd4vj\xe6J\x00\x00\x1e\xc0+\xc0/\xcc\xa9\xcc\xa8\xc0,\xc00\xc0')
    • Chrome browser shows: ERR_SSL_PROTOCOL_ERROR
    • Mozilla Firefox shows:

[quote]Secure Connection Failed
An error occurred during a connection to IP:8069. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG

The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
[/quote]

  • Didn’t ask for database creation. Showed Login screen (admin/admin) and a link to Manage Databases and set a master password. There was a default odoo database with Administrator and demo user.
3 Likes

Thanks for your feedback, I already did some changes like typos and yum install…

My testsystem was not that good, many packages installed, tested other software, so I’ll go through the howto with a fresh installation the next days…

Builtin server of Odoo just does http, so there’s another mission with nginx proxy:
https://www.odoo.com/documentation/10.0/setup/deploy.html#https

I created a user with phppgmyadmin without a database, so I got the db creation screen.
Maybe you did the command line way with creating role and db so no db creation screen, would make sense.
Important is the user, as user postgres is not allowed, it seems like the DB will be created, just when necessary.

Indeed, I used command line

I had no trouble getting Odoo installed, although it has broken Yum for some reason with “The install/update may have failed due to metadata caching issues. Please clean the cache by clicking the button below and retry the install/update operation.” now being displayed, No amount of clearing the cache will fix this :frowning:

Now if anyone can help how do i setup Neth Server email to work with Odoo and fix Yum? I would like to use this setup in a production environment.

Hi @Clinton_McDonald,

did you check this thread?

Are you able to update via command line?

yum update

When I find time, I’ll try to setup mail in odoo and post my experience…

1 Like

This is another great application that uses PostgreSQL as database backend. SavaPage also uses PostgreSQL and there are probably several other applications that could be an enhancement for NetrhServer that rely on PostgreSQL.
Would it be a strange idea to have a NethServer-postgresql package to choose from in the standard category in SoftwareCenter? Anyone willing/able to make one?

Do you know this posting:
https://community.nethserver.org/t/postgresql-on-ns7/8233
Maybe you can work together… ?

2 Likes

Hi Markus,

Thank you for the reply :slight_smile:

yes tried all that from a terminal with no success, had a look for the log /etc/yum/vars/nsrelease its not there, there is a file /etc/yum/vars/infra with on entry in it “stock” this test server had been online and updating fine for over a month till i installed Odoo. im wondering if Odoo has pulled something in that has caused yum to fail. I will try this again with another fresh install and see what happens.

i have been using a Turnkey Odoo apliance with no email at all for the last couple of years, but would like to have Neth Server instead as i hopefully will be able to connect Odoo strait back to Neth Server for email all on one VM. this will be sitting behind another Neth Server acting as a reverse proxy and email forwarder/antivirus for several VM’s. Getting this running would give me somewhere so start.

Any help from you or any one can give would be awesome :slight_smile:

2 Likes

I confirm your HowTo is working as expected. Did the commandline way. Didn’t have to install psutil 2.2.1.

Great job Markus!!

2 Likes

When I find time, I’ll try it.

Thnx for the offer @mrmarkuz.
As @fausp already pointed out, there already is one. See http://docs.nethserver.org/projects/nethserver-devel/en/v7/nethserver-postgresql.html

1 Like

Is there anyone who is using odoo in production on NethServer?

Our Odoo is running on a Ubuntu 16.04 plattform in the same network ;-).

1 Like

Good to know! Any test on NethServer anyway?

no not at the moment

Me :wink:

2 Likes

i am using a Turnkey linux Odoo apliance “Debian” in production only the web site building module though as have not found a good solution for the email side of it. :disappointed: