Skip to content

Commit 4266e18

Browse files
authored
WIP: Odoo 11 installation script (compatibility for Py2 & Py3)
1 parent ac5ed16 commit 4266e18

1 file changed

Lines changed: 17 additions & 18 deletions

File tree

odoo_install.sh

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
################################################################################
3-
# Script for installing Odoo V10 on Ubuntu 16.04, 15.04, 14.04 (could be used for other version too)
3+
# Script for installing Odoo on Ubuntu 14.04, 15.04 and 16.04 (could be used for other version too)
44
# Author: Yenthe Van Ginneken
55
#-------------------------------------------------------------------------------
66
# This script will install Odoo on your Ubuntu 14.04 server. It can install multiple Odoo instances
@@ -24,10 +24,10 @@ OE_HOME_EXT="/$OE_USER/${OE_USER}-server"
2424
INSTALL_WKHTMLTOPDF="True"
2525
#Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.)
2626
OE_PORT="8069"
27-
#Choose the Odoo version which you want to install. For example: 10.0, 9.0, 8.0, 7.0 or saas-6. When using 'trunk' the master version will be installed.
28-
#IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 10.0
29-
OE_VERSION="10.0"
30-
# Set this to True if you want to install Odoo 10 Enterprise!
27+
#Choose the Odoo version which you want to install. For example: 9.0, 8.0, 7.0 or saas-6. When using 'trunk' the master version will be installed.
28+
#IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 9.0
29+
OE_VERSION="11.0"
30+
# Set this to True if you want to install Odoo 9 Enterprise!
3131
IS_ENTERPRISE="False"
3232
#set the superadmin password
3333
OE_SUPERADMIN="admin"
@@ -60,14 +60,20 @@ sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true
6060
#--------------------------------------------------
6161
# Install Dependencies
6262
#--------------------------------------------------
63+
echo -e "\n--- Installing Python 3 + pip3 --"
64+
sudo apt-get install python3 python3-pip
65+
6366
echo -e "\n---- Install tool packages ----"
64-
sudo apt-get install wget git python-pip gdebi-core -y
67+
sudo apt-get install wget git bzr python-pip gdebi-core -y
6568

6669
echo -e "\n---- Install python packages ----"
67-
sudo apt-get install python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil -y python-suds
70+
sudo apt-get install python-pypdf2 python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil -y
71+
sudo pip3 install pypdf2 Babel passlib Werkzeug decorator python-dateutil pyyaml psycopg2 psutil html2text docutils
6872

6973
echo -e "\n---- Install python libraries ----"
70-
sudo pip install gdata psycogreen ofxparse XlsxWriter xlrd
74+
sudo pip install gdata psycogreen
75+
# This is for compatibility with Ubuntu 16.04. Will work on 14.04, 15.04 and 16.04
76+
sudo -H pip install suds
7177

7278
echo -e "\n--- Install other required packages"
7379
sudo apt-get install node-clean-css -y
@@ -78,7 +84,7 @@ sudo apt-get install python-gevent -y
7884
# Install Wkhtmltopdf if needed
7985
#--------------------------------------------------
8086
if [ $INSTALL_WKHTMLTOPDF = "True" ]; then
81-
echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 10 ----"
87+
echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 11 ----"
8288
#pick up correct one from x64 & x32 versions:
8389
if [ "`getconf LONG_BIT`" == "64" ];then
8490
_url=$WKHTMLTOX_X64
@@ -115,15 +121,15 @@ if [ $IS_ENTERPRISE = "True" ]; then
115121
sudo su $OE_USER -c "mkdir $OE_HOME/enterprise"
116122
sudo su $OE_USER -c "mkdir $OE_HOME/enterprise/addons"
117123

118-
GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch 10.0 https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1)
124+
GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1)
119125
while [[ $GITHUB_RESPONSE == *"Authentication"* ]]; do
120126
echo "------------------------WARNING------------------------------"
121127
echo "Your authentication with Github has failed! Please try again."
122128
printf "In order to clone and install the Odoo enterprise version you \nneed to be an offical Odoo partner and you need access to\nhttp://github.com/odoo/enterprise.\n"
123129
echo "TIP: Press ctrl+c to stop this script."
124130
echo "-------------------------------------------------------------"
125131
echo " "
126-
GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch 10.0 https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1)
132+
GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1)
127133
done
128134

129135
echo -e "\n---- Added Enterprise code under $OE_HOME/enterprise/addons ----"
@@ -183,16 +189,12 @@ PATH=/bin:/sbin:/usr/bin
183189
DAEMON=$OE_HOME_EXT/odoo-bin
184190
NAME=$OE_CONFIG
185191
DESC=$OE_CONFIG
186-
187192
# Specify the user name (Default: odoo).
188193
USER=$OE_USER
189-
190194
# Specify an alternate config file (Default: /etc/openerp-server.conf).
191195
CONFIGFILE="/etc/${OE_CONFIG}.conf"
192-
193196
# pidfile
194197
PIDFILE=/var/run/\${NAME}.pid
195-
196198
# Additional options that are passed to the Daemon.
197199
DAEMON_OPTS="-c \$CONFIGFILE"
198200
[ -x \$DAEMON ] || exit 0
@@ -203,7 +205,6 @@ pid=\`cat \$PIDFILE\`
203205
[ -d /proc/\$pid ] && return 0
204206
return 1
205207
}
206-
207208
case "\${1}" in
208209
start)
209210
echo -n "Starting \${DESC}: "
@@ -218,7 +219,6 @@ start-stop-daemon --stop --quiet --pidfile \$PIDFILE \
218219
--oknodo
219220
echo "\${NAME}."
220221
;;
221-
222222
restart|force-reload)
223223
echo -n "Restarting \${DESC}: "
224224
start-stop-daemon --stop --quiet --pidfile \$PIDFILE \
@@ -234,7 +234,6 @@ N=/etc/init.d/\$NAME
234234
echo "Usage: \$NAME {start|stop|restart|force-reload}" >&2
235235
exit 1
236236
;;
237-
238237
esac
239238
exit 0
240239
EOF

0 commit comments

Comments
 (0)