Howto install Odoo 11

crm

(Markus Neuberger) #1

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:


Howto install Odoo 10
We Are NethServer - Community Overview - Sep 18
Python software collection needs testers
(Michel-André) #2

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é


(Dan) #3

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


(Michel-André) #4

Hi danb35,

Thank you for your reply,

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

Michel-André


(Markus Neuberger) #5

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


(Michel-André) #6

Hi Markus,

Thank you for your reply.

Can you explain a little more please?

Michel-André


(Markus Neuberger) #7

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


(Ralf Jeckel) #8

Hi Markus,

your solution works (at least for http):

So, thanks also from me! :slight_smile:


(Michel-André) #9

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.


(Michel-André) #10

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é


#11

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


(Michel-André) #12

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é


(Michel-André) #13

[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é