Howto install Odoo 11

Hi,

Odoo 11 is working on Nethserver. :sunglasses:
Git is used now to download odoo and python35 needs to be installed.

Installation

To use a more secure postgresql password change “SECRET” to whatever you like. Don’t forget to change it in the configuration part below too.

# install dependencies
yum -y install nethserver-postgresql rh-python35 git gcc wget nodejs-less libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel postgresql-devel https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.1/wkhtmltox-0.12.1_linux-centos7-amd64.rpm

# create odoo user
useradd -m -U -r -d /opt/odoo -s /bin/bash odoo

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

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

# install odoo from git as user odoo
su - odoo
git clone https://www.github.com/odoo/odoo --depth 1 --branch 11.0 /opt/odoo/odoo11
scl enable rh-python35 bash
cd /opt/odoo

# create and activate virtual environment for odoo
python3 -m venv odoo11-venv
source odoo11-venv/bin/activate

# install odoo requirements
pip3 install -r odoo11/requirements.txt

# exit virtual environment
deactivate && exit
exit

Configuration

You may change the admin_passwd, it’s set to admin here:

# create odoo config file
cat << EOL > /etc/odoo11.conf
[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 = /opt/odoo/odoo11/addons
; If you are using custom modules
; addons_path = /opt/odoo/odoo11/addons,/opt/odoo/odoo11-custom-addons
EOL

# create odoo service
cat << EOL > /etc/systemd/system/odoo11.service
[Unit]
Description=Odoo11
Requires=postgresql.service
After=network.target postgresql.service

[Service]
Type=simple
SyslogIdentifier=odoo11
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/usr/bin/scl enable rh-python35 -- /opt/odoo/odoo11-venv/bin/python3 /opt/odoo/odoo11/odoo-bin -c /etc/odoo11.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target
EOL

# apply/enable service and start odoo
systemctl daemon-reload
systemctl enable odoo11 --now

Odoo is now reachable at http://YOURNETHSERVER:8069. Username and password is admin, if you didn’t change.

Source:

In French

@michelandre wrote an entire PDF available here

https://www.micronator.org/affaires/produit/nethserver-201-cahier-02_odoo-12/

7 Likes

Hi mrmarkuz,

Great how-to !

I would like to use http://YOURNETHSERVER/odoo instead of using http://YOURNETHSERVER:8069

I modified /etc/httpd/conf/httpd.cnf to enable .htaccess files:
<Directory “/var/www/html”>

# AllowOverride None
   AllowOverride All

I tried different .htaccess directives with no luck…

I found a way with iptables:

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8069

It is working but it redirects main site also.

Is it possible to use http://YOURNETHSERVER/odoo

Thank you in advance,

Michel-André

1 Like

I haven’t tried this (or run Odoo at all, for that matter), but the reverse proxy configuration should do what you’re looking for:
http://docs.nethserver.org/en/v7/proxy_pass.html

2 Likes

Hi danb35,

Thank you for your reply,

If I enter a port like FQDN:8069 it says: Invalid URL syntax.

Michel-André

The URL path rule (https://NETHSERVER/odoo) may not work.
A virtual host rule (https://ODOO_VIRTUALHOST) should work in any case.

Hi Markus,

Thank you for your reply.

Can you explain a little more please?

Michel-André

There are two types of rules and the virtual host rule should work but I didn’t test.

http://docs.nethserver.org/en/v7/proxy_pass.html#path-and-virtual-host-rules

Hi Markus,

your solution works (at least for http):

So, thanks also from me! :slight_smile:

1 Like

Hi Markus,

You’re the best!

At first, I figured if I had to use FQDN:8069 I’m just as good at trying to install Odoo-12.

I installed PostgreSQL-11, RH-Python-36 and Odoo-12 following the documentation I had written for SME-9.2 and your documentation above.

After multiple difficulties, I finally managed to run Odoo-12.

With your detailed explanations for using the reverse proxy for redirection and following the how-to “Let’s Encrypt for Internal Servers” from https://wiki.nethserver.org/doku.php?id=userguide:let_s_encrypt_for_internal_servers now everything works perfectly and access is secure.

Once again, a thousand thanks for your precious explanations.

Michel-André

P.S. On my website, the installation document of Odoo is among the most downloaded.
When I finish my documentation on Odoo-12 and NethServer, I’ll put it on my website.

1 Like

Hi Markus,

OS: NethServer-7.6.1810 same as Centos-7.6.1810 // updated as of today.
Running under VirtualBox: Version 6.0.4 r128413 (Qt5.6.2)

- User: odoo
  personnal folder: /opt/odoo

- Odoo version: 12
- Installation path: /opt/odoo/odoo-12
- Service name: odoo12
- DataBase: Odoo-12

Everything is working correctly.

I want to update according: (scroll down the following link a bit to see the update how-to ): https://www.cier.tech/fr_FR/blog/notre-blog-1/post/how-to-update-odoo-from-github-25 .

# systemctl stop odoo12

# su - odoo

$ whoami
  odoo

$ cd /opt/odoo/odoo12

$ pwd
  /opt/odoo/odoo12

$ git fetch origin 12.0
  remote: Enumerating objects: 1459, done.
  remote: Counting objects: 100% (1459/1459), done.
  remote: Compressing objects: 100% (580/580), done.
  remote: Total 867 (delta 710), reused 333 (delta 285), pack-reused 0
  Receiving objects: 100% (867/867), 1.88 MiB | 137.00 KiB/s, done.
  Resolving deltas: 100% (710/710), completed with 487 local objects.
  From https://github.com/odoo/odoo
   * branch            12.0       -> FETCH_HEAD

$ git reset --hard origin/12.0
  HEAD is now at c545783 [FIX] account: communication size
 $ exit

At the end of the upadate I am suppose to update the DataBase.
As user root:

# systemctl  restart  odoo12  -u all  -d Odoo-12
  invalid option -- 'u'

I also tried as user odoo:

# usermod -aG wheel odoo

# visudo
...
## Allows people in group wheel to run all commands
%wheel  ALL=(ALL)       ALL
...

# su - odoo

$ sudo systemctl restart odoo12 -u all -d Odoo-12
  [sudo] password for odoo:  ODOO PASSWORD
  systemctl: invalid option -- 'u'

It looks like the parameters are passed to the systemctl and not to odoo12 service.

Is there a way to pass those parameters to odoo12 service?

Thank you in advance,

Michel-André

Odoo is very interesting, but $3k per yr for the shipping api is steep for my clients, how much are you guys paying out?

Hi fasttech,

$0.00 and I will not pay later.

I use the community edition and only to write an how to for my web page as it is one of the most downloaded how to with Dolibarr which is almost equivalent (https://www.micronator.org/affaires/produit/nethserver-201-cahier-01dolibarr/).

Michel-André

[SOLVED] Updating DB after updated Odoo 12

Hi all,

From the command line, user odoo using:

/usr/bin/scl enable rh-python36 -- /opt/odoo/odoo12-venv/bin/python3 /opt/odoo/odoo12/odoo-bin -c /etc/odoo-server.conf -u all  -d Odoo-12

from the exec command line, in the odoo service config file, worked perfectly.

Michel-André

2 Likes

Hi all,

Finally, I finished writing a how-to (in French) for installing Odoo-12 on a NethServer-7.6.1810:
https://www.micronator.org/affaires/produit/nethserver-201-cahier-02_odoo-12/

Any comments or suggestions appreciated.

Michel-André

P.S. With all the details and screenshots provided, my grandmother should be able to perform this installation.

2 Likes

My grandmother can only speak and read English…

Looks really interesting! Thanks for that :slight_smile: Just added to the first post @mrmarkuz

1 Like

Hi,

I am facing issues with odoo11.

[root@mc ~]# systemctl status odoo11

odoo11.service - Odoo11

Loaded: loaded (/etc/systemd/system/odoo11.service; enabled; vendor preset: disabled)

Active: failed (Result: exit-code) since Mon 2019-11-25 12:21:12 CET; 1h 42min ago

Process: 26030 ExecStart=/usr/bin/scl enable rh-python35 – /opt/odoo/odoo11-venv/bin/python3 /opt/odoo/odoo11/odoo-bin -c /etc/odoo11.conf (code=exited, status=2)

Main PID: 26030 (code=exited, status=2)

Nov 25 12:21:11 mc.example.com systemd[1]: Started Odoo11.

Nov 25 12:21:12 mc.example.com odoo11[26030]: Usage: odoo-bin [options]

Nov 25 12:21:12 mc.example.com odoo11[26030]: odoo-bin: error: The config file ‘/etc/odoo11.conf’ selected with -c/–config doesn’t exist or is not reada…nerate it

Nov 25 12:21:12 mc.example.com systemd[1]: odoo11.service: main process exited, code=exited, status=2/INVALIDARGUMENT

Nov 25 12:21:12 mc.example.com systemd[1]: Unit odoo11.service entered failed state.

Nov 25 12:21:12 mc.example.com systemd[1]: odoo11.service failed.

Hint: Some lines were ellipsized, use -l to show in full.

Does /etc/odoo11.conf exist?

What about using/updating to Odoo 12 as @michelandre explained ?

Hi, thanks for reply

i followed @michelandre, odoo11 points. So i am facing this type of error.
/etc/odoo11.conf doesn’t exist, because its linked to /opt/odoo11

1 more question - Will all nethserver users will login in odoo in this way ?

Hi Hitesh,

The PDF for Odoo-12 is at:
https://www.micronator.org/affaires/produit/nethserver-201-cahier-02_odoo-12/

You can try Flectra which is a fork of Odoo and it’s all OpenSource with no cost for extra packages.
The PDF for Flectra is at:
https://www.micronator.org/affaires/produit/nethserver-201-cahier-07-flectra/

You can also try Dolibarr.
The PDF for Dolibar is at:
https://www.micronator.org/affaires/produit/nethserver-201-cahier-01dolibarr/

Registration is required for the PDFs.

Google translation is your friend:
https://translate.google.ca/?hl=fr#view=home&op=translate&sl=fr&tl=en

For your problem, as Markus pointed out: “/etc/odoo11.conf” exist? If not, you have to create the /etc/odoo11.conf. Same for Odoo-12 and Flectra. All the details are described in the PDFs.

Michel-André

1 Like