forked from Yenthe666/InstallScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathodoo_install.sh
More file actions
592 lines (555 loc) · 29.8 KB
/
odoo_install.sh
File metadata and controls
592 lines (555 loc) · 29.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
#!/bin/bash
################################################################################
# Script for installing Odoo on Ubuntu 14.04, 15.04, 16.04 and 18.04 (could be used for other version too)
# Author: Yenthe Van Ginneken
#-------------------------------------------------------------------------------
# This script will install Odoo on your Ubuntu 16.04 server. It can install multiple Odoo instances
# in one Ubuntu because of the different xmlrpc_ports
#-------------------------------------------------------------------------------
# Make a new file:
# sudo nano odoo-install.sh
# Place this content in it and then make the file executable:
# sudo chmod +x odoo-install.sh
# Execute the script to install Odoo:
# ./odoo-install
################################################################################
OE_USER="odoo"
OE_HOME="/$OE_USER"
OE_HOME_EXT="/$OE_USER/${OE_USER}-server"
# The default port where this Odoo instance will run under (provided you use the command -c in the terminal)
# Set to true if you want to install it, false if you don't need it or have it already installed.
INSTALL_WKHTMLTOPDF="True"
# Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.)
OE_PORT="8069"
# Choose the Odoo version which you want to install. For example: 13.0, 12.0, 11.0 or saas-18. When using 'master' the master version will be installed.
# IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 13.0
OE_VERSION="16.0"
# Set this to True if you want to install the Odoo enterprise version!
IS_ENTERPRISE="False"
# Set this to True if you want to install Nginx!
INSTALL_NGINX="False"
# Set the superadmin password - if GENERATE_RANDOM_PASSWORD is set to "True" we will automatically generate a random password, otherwise we use this one
OE_SUPERADMIN="admin"
# Set to "True" to generate a random password, "False" to use the variable in OE_SUPERADMIN
GENERATE_RANDOM_PASSWORD="True"
OE_CONFIG="${OE_USER}-server"
# Set the website name
WEBSITE_NAME="_"
# Set the default Odoo longpolling port (you still have to use -c /etc/odoo-server.conf for example to use this.)
LONGPOLLING_PORT="8072"
# Set to "True" to install certbot and have ssl enabled, "False" to use http
ENABLE_SSL="True"
# Provide Email to register ssl certificate
ADMIN_EMAIL="[email protected]"
# Set Custom Modules
OCA="True"
SAAS="True"
CybroOdoo="True"
MuKIT="True"
SythilTech="True"
odoomates="True"
openeducat="False"
Openworx="True"
JayVoraSerpentCS="True"
##
### WKHTMLTOPDF download links
## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links,
## in order to have correct version of wkhtmltopdf installed, for a danger note refer to
## https://github.com/odoo/odoo/wiki/Wkhtmltopdf ):
## https://www.odoo.com/documentation/13.0/setup/install.html#debian-ubuntu
WKHTMLTOX_X64="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.$(lsb_release -c -s)_amd64.deb"
WKHTMLTOX_X32="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.$(lsb_release -c -s)_i386.deb"
#--------------------------------------------------
# Update Server
#--------------------------------------------------
echo -e "\n---- Update Server ----"
# universe package is for Ubuntu 18.x
sudo add-apt-repository universe
# libpng12-0 dependency for wkhtmltopdf
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ xenial main"
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install libpq-dev
#--------------------------------------------------
# Install PostgreSQL Server
#--------------------------------------------------
#echo -e "\n---- Install PostgreSQL Server ----"
sudo apt-get install postgresql postgresql-server-dev-all -y
#echo -e "\n---- Creating the ODOO PostgreSQL User ----"
sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true
#--------------------------------------------------
# Install Dependencies
#--------------------------------------------------
echo -e "\n--- Installing Python 3 + pip3 --"
sudo apt-get install python3 python3-pip
sudo apt-get install git python3-cffi build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libpng-dev libjpeg-dev gdebi -y
echo -e "\n---- Install python packages/requirements ----"
sudo -H pip3 install -r https://github.com/odoo/odoo/raw/${OE_VERSION}/requirements.txt
echo -e "\n---- Installing nodeJS NPM and rtlcss for LTR support ----"
sudo apt-get install nodejs npm -y
sudo npm install -g rtlcss
#--------------------------------------------------
# Install Wkhtmltopdf if needed
#--------------------------------------------------
if [ $INSTALL_WKHTMLTOPDF = "True" ]; then
echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 13 ----"
#pick up correct one from x64 & x32 versions:
if [ "`getconf LONG_BIT`" == "64" ];then
_url=$WKHTMLTOX_X64
else
_url=$WKHTMLTOX_X32
fi
sudo wget $_url
sudo gdebi --n `basename $_url`
sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin
sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin
else
echo "Wkhtmltopdf isn't installed due to the choice of the user!"
fi
echo -e "\n---- Create ODOO system user ----"
sudo adduser --system --quiet --shell=/bin/bash --home=$OE_HOME --gecos 'ODOO' --group $OE_USER
#The user should also be added to the sudo'ers group.
sudo adduser $OE_USER sudo
echo -e "\n---- Create Log directory ----"
sudo mkdir /var/log/$OE_USER
sudo chown $OE_USER:$OE_USER /var/log/$OE_USER
#--------------------------------------------------
# Install ODOO
#--------------------------------------------------
echo -e "\n==== Installing ODOO Server ===="
sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/odoo $OE_HOME_EXT/
if [ $IS_ENTERPRISE = "True" ]; then
# Odoo Enterprise install!
sudo pip3 install psycopg2-binary pdfminer.six
echo -e "\n--- Create symlink for node"
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo su $OE_USER -c "mkdir $OE_HOME/enterprise"
sudo su $OE_USER -c "mkdir $OE_HOME/enterprise/addons"
GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1)
while [[ $GITHUB_RESPONSE == *"Authentication"* ]]; do
echo "------------------------WARNING------------------------------"
echo "Your authentication with Github has failed! Please try again."
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"
echo "TIP: Press ctrl+c to stop this script."
echo "-------------------------------------------------------------"
echo " "
GITHUB_RESPONSE=$(sudo git clone --depth 1 --branch $OE_VERSION https://www.github.com/odoo/enterprise "$OE_HOME/enterprise/addons" 2>&1)
done
echo -e "\n---- Added Enterprise code under $OE_HOME/enterprise/addons ----"
echo -e "\n---- Installing Enterprise specific libraries ----"
sudo -H pip3 install num2words ofxparse dbfread ebaysdk firebase_admin pyOpenSSL
sudo npm install -g less
sudo npm install -g less-plugin-clean-css
fi
echo -e "\n---- Create custom module directory ----"
sudo su $OE_USER -c "mkdir $OE_HOME/custom"
sudo su $OE_USER -c "mkdir $OE_HOME/custom/addons"
echo -e "\n---- Setting permissions on home folder ----"
sudo chown -R $OE_USER:$OE_USER $OE_HOME/*
echo -e "* Create server config file"
sudo touch /etc/${OE_CONFIG}.conf
echo -e "* Creating server config file"
sudo su root -c "printf '[options] \n; This is the password that allows database operations:\n' >> /etc/${OE_CONFIG}.conf"
if [ $GENERATE_RANDOM_PASSWORD = "True" ]; then
echo -e "* Generating random admin password"
OE_SUPERADMIN=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
fi
sudo su root -c "printf 'admin_passwd = ${OE_SUPERADMIN}\n' >> /etc/${OE_CONFIG}.conf"
if [ $OE_VERSION > "11.0" ];then
sudo su root -c "printf 'http_port = ${OE_PORT}\n' >> /etc/${OE_CONFIG}.conf"
else
sudo su root -c "printf 'xmlrpc_port = ${OE_PORT}\n' >> /etc/${OE_CONFIG}.conf"
fi
sudo su root -c "printf 'logfile = /var/log/${OE_USER}/${OE_CONFIG}.log\n' >> /etc/${OE_CONFIG}.conf"
if [ $IS_ENTERPRISE = "True" ]; then
sudo su root -c "printf 'addons_path=${OE_HOME}/enterprise/addons,${OE_HOME_EXT}/addons\n' >> /etc/${OE_CONFIG}.conf"
else
sudo su root -c "printf 'addons_path=${OE_HOME_EXT}/addons,${OE_HOME}/custom/addons\n' >> /etc/${OE_CONFIG}.conf"
fi
sudo chown $OE_USER:$OE_USER /etc/${OE_CONFIG}.conf
sudo chmod 640 /etc/${OE_CONFIG}.conf
echo -e "* Create startup file"
sudo su root -c "echo '#!/bin/sh' >> $OE_HOME_EXT/start.sh"
sudo su root -c "echo 'sudo -u $OE_USER $OE_HOME_EXT/odoo-bin --config=/etc/${OE_CONFIG}.conf' >> $OE_HOME_EXT/start.sh"
sudo chmod 755 $OE_HOME_EXT/start.sh
#--------------------------------------------------
# Adding ODOO as a deamon (initscript)
#--------------------------------------------------
echo -e "* Create init file"
cat <<EOF > ~/$OE_CONFIG
#!/bin/sh
### BEGIN INIT INFO
# Provides: $OE_CONFIG
# Required-Start: \$remote_fs \$syslog
# Required-Stop: \$remote_fs \$syslog
# Should-Start: \$network
# Should-Stop: \$network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Enterprise Business Applications
# Description: ODOO Business Applications
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DAEMON=$OE_HOME_EXT/odoo-bin
NAME=$OE_CONFIG
DESC=$OE_CONFIG
# Specify the user name (Default: odoo).
USER=$OE_USER
# Specify an alternate config file (Default: /etc/openerp-server.conf).
CONFIGFILE="/etc/${OE_CONFIG}.conf"
# pidfile
PIDFILE=/var/run/\${NAME}.pid
# Additional options that are passed to the Daemon.
DAEMON_OPTS="-c \$CONFIGFILE"
[ -x \$DAEMON ] || exit 0
[ -f \$CONFIGFILE ] || exit 0
checkpid() {
[ -f \$PIDFILE ] || return 1
pid=\`cat \$PIDFILE\`
[ -d /proc/\$pid ] && return 0
return 1
}
case "\${1}" in
start)
echo -n "Starting \${DESC}: "
start-stop-daemon --start --quiet --pidfile \$PIDFILE \
--chuid \$USER --background --make-pidfile \
--exec \$DAEMON -- \$DAEMON_OPTS
echo "\${NAME}."
;;
stop)
echo -n "Stopping \${DESC}: "
start-stop-daemon --stop --quiet --pidfile \$PIDFILE \
--oknodo
echo "\${NAME}."
;;
restart|force-reload)
echo -n "Restarting \${DESC}: "
start-stop-daemon --stop --quiet --pidfile \$PIDFILE \
--oknodo
sleep 1
start-stop-daemon --start --quiet --pidfile \$PIDFILE \
--chuid \$USER --background --make-pidfile \
--exec \$DAEMON -- \$DAEMON_OPTS
echo "\${NAME}."
;;
*)
N=/etc/init.d/\$NAME
echo "Usage: \$NAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
EOF
echo -e "* Security Init File"
sudo mv ~/$OE_CONFIG /etc/init.d/$OE_CONFIG
sudo chmod 755 /etc/init.d/$OE_CONFIG
sudo chown root: /etc/init.d/$OE_CONFIG
echo -e "* Start ODOO on Startup"
sudo update-rc.d $OE_CONFIG defaults
#--------------------------------------------------
# Adding ODOO as a Modules (initscript)
#--------------------------------------------------
echo -e "install odoo Modules"
cd $OE_HOME/custom
if [ $OCA = "True" ]; then
REPOS=( "${REPOS[@]}" "https://github.com/oca/account-analytic.git oca/account-analytic")
REPOS=( "${REPOS[@]}" "https://github.com/oca/account-budgeting.git oca/account-budgeting")
REPOS=( "${REPOS[@]}" "https://github.com/oca/account-closing.git oca/account-closing")
REPOS=( "${REPOS[@]}" "https://github.com/oca/account-consolidation.git oca/account-consolidation")
REPOS=( "${REPOS[@]}" "https://github.com/oca/account-financial-reporting.git oca/account-financial-reporting")
REPOS=( "${REPOS[@]}" "https://github.com/oca/account-financial-tools.git oca/account-financial-tools")
REPOS=( "${REPOS[@]}" "https://github.com/oca/account-fiscal-rule.git oca/account-fiscal-rule")
REPOS=( "${REPOS[@]}" "https://github.com/oca/account-invoice-reporting.git oca/account-invoice-reporting")
REPOS=( "${REPOS[@]}" "https://github.com/oca/account-invoicing.git oca/account-invoicing")
REPOS=( "${REPOS[@]}" "https://github.com/oca/account-payment.git oca/account-payment")
REPOS=( "${REPOS[@]}" "https://github.com/oca/account-reconcile.git oca/account-reconcile")
REPOS=( "${REPOS[@]}" "https://github.com/oca/bank-payment.git oca/bank-payment")
REPOS=( "${REPOS[@]}" "https://github.com/oca/bank-statement-import.git oca/bank-statement-import")
REPOS=( "${REPOS[@]}" "https://github.com/oca/commission.git oca/commission")
REPOS=( "${REPOS[@]}" "https://github.com/oca/community-data-files.git oca/community-data-files")
REPOS=( "${REPOS[@]}" "https://github.com/oca/connector.git oca/connector")
REPOS=( "${REPOS[@]}" "https://github.com/oca/connector-telephony.git oca/connector-telephony")
REPOS=( "${REPOS[@]}" "https://github.com/oca/contract.git oca/contract")
REPOS=( "${REPOS[@]}" "https://github.com/oca/credit-control.git oca/credit-control")
REPOS=( "${REPOS[@]}" "https://github.com/oca/crm.git oca/crm")
REPOS=( "${REPOS[@]}" "https://github.com/oca/currency.git oca/currency")
REPOS=( "${REPOS[@]}" "https://github.com/oca/data-protection.git oca/data-protection")
REPOS=( "${REPOS[@]}" "https://github.com/oca/ddmrp.git oca/ddmrp")
REPOS=( "${REPOS[@]}" "https://github.com/oca/delivery-carrier.git oca/delivery-carrier")
REPOS=( "${REPOS[@]}" "https://github.com/oca/e-commerce.git oca/e-commerce")
REPOS=( "${REPOS[@]}" "https://github.com/oca/edi.git oca/edi")
REPOS=( "${REPOS[@]}" "https://github.com/oca/event.git oca/event")
REPOS=( "${REPOS[@]}" "https://github.com/oca/field-service.git oca/field-service")
REPOS=( "${REPOS[@]}" "https://github.com/oca/geospatial.git oca/geospatial")
REPOS=( "${REPOS[@]}" "https://github.com/oca/hr.git oca/hr")
REPOS=( "${REPOS[@]}" "https://github.com/OCA/timesheet.git oca/timesheet")
REPOS=( "${REPOS[@]}" "https://github.com/oca/iot.git oca/iot")
REPOS=( "${REPOS[@]}" "https://github.com/oca/knowledge.git oca/knowledge")
REPOS=( "${REPOS[@]}" "https://github.com/oca/management-system.git oca/management-system")
REPOS=( "${REPOS[@]}" "https://github.com/oca/manufacture.git oca/manufacture")
REPOS=( "${REPOS[@]}" "https://github.com/oca/manufacture-reporting.git oca/manufacture-reporting")
REPOS=( "${REPOS[@]}" "https://github.com/oca/margin-analysis.git oca/margin-analysis")
REPOS=( "${REPOS[@]}" "https://github.com/oca/mis-builder.git oca/mis-builder")
REPOS=( "${REPOS[@]}" "https://github.com/oca/multi-company.git oca/multi-company")
REPOS=( "${REPOS[@]}" "https://github.com/oca/operating-unit.git oca/operating-unit")
REPOS=( "${REPOS[@]}" "https://github.com/oca/partner-contact.git oca/partner-contact")
REPOS=( "${REPOS[@]}" "https://github.com/oca/pos.git oca/pos")
REPOS=( "${REPOS[@]}" "https://github.com/oca/product-attribute.git oca/product-attribute")
REPOS=( "${REPOS[@]}" "https://github.com/oca/product-kitting.git oca/product-kitting")
REPOS=( "${REPOS[@]}" "https://github.com/oca/product-variant.git oca/product-variant")
REPOS=( "${REPOS[@]}" "https://github.com/oca/project.git oca/project")
REPOS=( "${REPOS[@]}" "https://github.com/oca/project-reporting.git oca/project-reporting")
REPOS=( "${REPOS[@]}" "https://github.com/oca/purchase-reporting.git oca/purchase-reporting")
REPOS=( "${REPOS[@]}" "https://github.com/oca/purchase-workflow.git oca/purchase-workflow")
REPOS=( "${REPOS[@]}" "https://github.com/oca/queue.git oca/queue")
REPOS=( "${REPOS[@]}" "https://github.com/oca/reporting-engine.git oca/reporting-engine")
REPOS=( "${REPOS[@]}" "https://github.com/oca/report-print-send.git oca/report-print-send")
REPOS=( "${REPOS[@]}" "https://github.com/oca/sale-financial.git oca/sale-financial")
REPOS=( "${REPOS[@]}" "https://github.com/oca/sale-reporting.git oca/sale-reporting")
REPOS=( "${REPOS[@]}" "https://github.com/oca/sale-workflow.git oca/sale-workflow")
REPOS=( "${REPOS[@]}" "https://github.com/oca/server-auth.git oca/server-auth")
REPOS=( "${REPOS[@]}" "https://github.com/oca/server-backend.git oca/server-backend")
REPOS=( "${REPOS[@]}" "https://github.com/oca/server-brand.git oca/server-brand")
REPOS=( "${REPOS[@]}" "https://github.com/oca/server-env.git oca/server-env")
REPOS=( "${REPOS[@]}" "https://github.com/oca/server-tools.git oca/server-tools")
REPOS=( "${REPOS[@]}" "https://github.com/oca/server-ux.git oca/server-ux")
REPOS=( "${REPOS[@]}" "https://github.com/oca/social.git oca/social")
REPOS=( "${REPOS[@]}" "https://github.com/oca/stock-logistics-barcode.git oca/stock-logistics-barcode")
REPOS=( "${REPOS[@]}" "https://github.com/oca/stock-logistics-reporting.git oca/stock-logistics-reporting")
REPOS=( "${REPOS[@]}" "https://github.com/oca/stock-logistics-tracking.git oca/stock-logistics-tracking")
REPOS=( "${REPOS[@]}" "https://github.com/oca/stock-logistics-transport.git oca/stock-logistics-transport")
REPOS=( "${REPOS[@]}" "https://github.com/oca/stock-logistics-warehouse.git oca/stock-logistics-warehouse")
REPOS=( "${REPOS[@]}" "https://github.com/oca/stock-logistics-workflow.git oca/stock-logistics-workflow")
REPOS=( "${REPOS[@]}" "https://github.com/oca/vertical-community.git oca/vertical-community")
REPOS=( "${REPOS[@]}" "https://github.com/oca/vertical-construction.git oca/vertical-construction")
REPOS=( "${REPOS[@]}" "https://github.com/oca/vertical-edition.git oca/vertical-edition")
REPOS=( "${REPOS[@]}" "https://github.com/oca/vertical-hotel.git oca/vertical-hotel")
REPOS=( "${REPOS[@]}" "https://github.com/oca/vertical-isp.git oca/vertical-isp")
REPOS=( "${REPOS[@]}" "https://github.com/oca/vertical-ngo.git oca/vertical-ngo")
REPOS=( "${REPOS[@]}" "https://github.com/oca/vertical-travel.git oca/vertical-travel")
REPOS=( "${REPOS[@]}" "https://github.com/oca/web.git oca/web")
REPOS=( "${REPOS[@]}" "https://github.com/oca/webkit-tools.git oca/webkit-tools")
REPOS=( "${REPOS[@]}" "https://github.com/oca/website.git oca/website")
REPOS=( "${REPOS[@]}" "https://github.com/OCA/storage.git oca/storage")
REPOS=( "${REPOS[@]}" "https://github.com/OCA/brand.git oca/brand")
REPOS=( "${REPOS[@]}" "https://github.com/OCA/rest-framework.git oca/rest-framework")
REPOS=( "${REPOS[@]}" "https://github.com/OCA/connector-jira.git oca/connector-jira")
REPOS=( "${REPOS[@]}" "https://github.com/OCA/search-engine.git oca/search-engine")
REPOS=( "${REPOS[@]}" "https://github.com/OCA/helpdesk.git oca/helpdesk")
REPOS=( "${REPOS[@]}" "https://github.com/OCA/product-pack.git oca/product-pack")
REPOS=( "${REPOS[@]}" "https://github.com/OCA/payroll.git oca/payroll")
REPOS=( "${REPOS[@]}" "https://github.com/OCA/wms.git oca/wms")
REPOS=( "${REPOS[@]}" "https://github.com/OCA/dms.git oca/dms")
fi
if [ $SAAS = "True" ]; then
REPOS=( "${REPOS[@]}" "https://github.com/it-projects-llc/e-commerce.git it-projects-llc/e-commerce")
REPOS=( "${REPOS[@]}" "https://github.com/it-projects-llc/pos-addons.git it-projects-llc/pos-addons")
REPOS=( "${REPOS[@]}" "https://github.com/it-projects-llc/access-addons.git it-projects-llc/access-addons")
REPOS=( "${REPOS[@]}" "https://github.com/it-projects-llc/website-addons.git it-projects-llc/website-addons")
REPOS=( "${REPOS[@]}" "https://github.com/it-projects-llc/misc-addons.git it-projects-llc/misc-addons")
REPOS=( "${REPOS[@]}" "https://github.com/it-projects-llc/mail-addons.git it-projects-llc/mail-addons")
REPOS=( "${REPOS[@]}" "https://github.com/it-projects-llc/odoo-saas-tools.git it-projects-llc/odoo-saas-tools")
REPOS=( "${REPOS[@]}" "https://github.com/it-projects-llc/odoo-telegram.git it-projects-llc/odoo-telegram")
fi
if [ $CybroOdoo = "True" ]; then
REPOS=( "${REPOS[@]}" "https://github.com/CybroOdoo/CybroAddons.git CybroOdoo/CybroAddons")
REPOS=( "${REPOS[@]}" "https://github.com/CybroOdoo/OpenHRMS.git CybroOdoo/OpenHRMS")
fi
if [ $MuKIT = "True" ]; then
REPOS=( "${REPOS[@]}" "https://github.com/muk-it/muk_base.git mukit/muk_base")
REPOS=( "${REPOS[@]}" "https://github.com/muk-it/muk_web.git mukit/muk_web")
REPOS=( "${REPOS[@]}" "https://github.com/muk-it/muk_bundles.git mukit/muk_bundles")
REPOS=( "${REPOS[@]}" "https://github.com/muk-it/muk_website.git mukit/muk_website")
REPOS=( "${REPOS[@]}" "https://github.com/muk-it/muk_misc.git mukit/muk_misc")
REPOS=( "${REPOS[@]}" "https://github.com/muk-it/muk_dms.git mukit/muk_dms")
REPOS=( "${REPOS[@]}" "https://github.com/muk-it/muk_docs.git mukit/muk_docs")
REPOS=( "${REPOS[@]}" "https://github.com/muk-it/muk_quality.git mukit/muk_quality")
fi
if [ $SythilTech = "True" ]; then
REPOS=( "${REPOS[@]}" "https://github.com/SythilTech/Odoo.git SythilTech/Odoo")
fi
if [ $odoomates = "True" ]; then
REPOS=( "${REPOS[@]}" "https://github.com/odoomates/odooapps.git odoomates/odooapps")
fi
if [ $openeducat = "True" ]; then
REPOS=( "${REPOS[@]}" "https://github.com/openeducat/openeducat_erp.git openeducat/openeducat_erp")
fi
if [ $JayVoraSerpentCS = "True" ]; then
REPOS=( "${REPOS[@]}" "https://github.com/JayVora-SerpentCS/OdooHotelManagementSystem.git JayVora-SerpentCS/OdooHotelManagementSystem")
REPOS=( "${REPOS[@]}" "https://github.com/JayVora-SerpentCS/SerpentCS_Contributions.git JayVora-SerpentCS/SerpentCS_Contributions")
REPOS=( "${REPOS[@]}" "https://github.com/JayVora-SerpentCS/Jasperreports_odoo.git JayVora-SerpentCS/Jasperreports_odoo")
REPOS=( "${REPOS[@]}" "https://github.com/JayVora-SerpentCS/MassEditing.git JayVora-SerpentCS/MassEditing")
REPOS=( "${REPOS[@]}" "https://github.com/JayVora-SerpentCS/fleet_management.git JayVora-SerpentCS/fleet_management")
REPOS=( "${REPOS[@]}" "https://github.com/JayVora-SerpentCS/DOST.git JayVora-SerpentCS/DOST")
REPOS=( "${REPOS[@]}" "https://github.com/JayVora-SerpentCS/Community_Portal.git JayVora-SerpentCS/Community_Portal")
fi
if [ $Openworx = "True" ]; then
REPOS=( "${REPOS[@]}" "https://github.com/Openworx/odoo-addons.git Openworx/odoo-addons")
REPOS=( "${REPOS[@]}" "https://github.com/Openworx/backend_theme.git Openworx/backend_theme")
fi
if [[ "${REPOS}" != "" ]]
then
apt-get install -y git
fi
for r in "${REPOS[@]}"
do
eval "git clone --depth=1 -b ${OE_VERSION} $r" || echo "Cannot clone: git clone -b ${OE_VERSION} $r"
done
if [[ "${REPOS}" != "" ]]
then
chown -R ${OE_USER}:${OE_USER} $OE_HOME/custom || true
fi
ADDONS_PATH=`ls -d1 /odoo/custom/*/* | tr '\n' ','`
ADDONS_PATH=`echo /odoo/odoo-server/addons,/odoo/custom/addons,$ADDONS_PATH | sed "s,//,/,g" | sed "s,/,\\\\\/,g" | sed "s,.$,,g" `
sed -ibak "s/addons_path.*/addons_path = $ADDONS_PATH/" /etc/odoo-server.conf
echo -e "install odoo requirements"
sudo pip3 install wheel
sudo apt install libldap2-dev libsasl2-dev
sudo pip3 install pyldap
sudo pip3 install -r /$OE_USER/$OE_CONFIG/requirements.txt
sudo pip3 install configparser
sudo pip3 install future
pip3 install num2words
pip3 install PyXB
pip3 install mysql-connector-python
pip3 install -r oca/account-analytic/requirements.txt
pip3 install -r oca/account-budgeting/requirements.txt
pip3 install -r oca/account-closing/requirements.txt
pip3 install -r oca/account-consolidation/requirements.txt
pip3 install -r oca/account-financial-reporting/requirements.txt
pip3 install -r oca/account-financial-tools/requirements.txt
pip3 install -r oca/account-fiscal-rule/requirements.txt
pip3 install -r oca/account-invoice-reporting/requirements.txt
pip3 install -r oca/account-invoicing/requirements.txt
pip3 install -r oca/account-payment/requirements.txt
pip3 install -r oca/account-reconcile/requirements.txt
pip3 install -r oca/bank-payment/requirements.txt
pip3 install -r oca/bank-statement-import/requirements.txt
pip3 install -r oca/commission/requirements.txt
pip3 install -r oca/community-data-files/requirements.txt
pip3 install -r oca/connector/requirements.txt
pip3 install -r oca/connector-accountedge/requirements.txt
pip3 install -r oca/connector-cmis/requirements.txt
pip3 install -r oca/connector-ecommerce/requirements.txt
pip3 install -r oca/connector-interfaces/requirements.txt
pip3 install -r oca/connector-lims/requirements.txt
pip3 install -r oca/connector-magento/requirements.txt
pip3 install -r oca/connector-prestashop/requirements.txt
pip3 install -r oca/connector-redmine/requirements.txt
pip3 install -r oca/connector-sage/requirements.txt
pip3 install -r oca/connector-salesforce/requirements.txt
pip3 install -r oca/connector-telephony/requirements.txt
pip3 install -r oca/contract/requirements.txt
pip3 install -r oca/credit-control/requirements.txt
pip3 install -r oca/crm/requirements.txt
pip3 install -r oca/currency/requirements.txt
pip3 install -r oca/data-protection/requirements.txt
pip3 install -r oca/ddmrp/requirements.txt
pip3 install -r oca/delivery-carrier/requirements.txt
pip3 install -r oca/e-commerce/requirements.txt
pip3 install -r oca/edi/requirements.txt
pip3 install -r oca/event/requirements.txt
pip3 install -r oca/field-service/requirements.txt
pip3 install -r oca/geospatial/requirements.txt
pip3 install -r oca/hr/requirements.txt
pip3 install -r oca/hr-timesheet/requirements.txt
pip3 install -r oca/iot/requirements.txt
pip3 install -r oca/knowledge/requirements.txt
pip3 install -r oca/l10n-argentina/requirements.txt
pip3 install -r oca/l10n-belgium/requirements.txt
pip3 install -r oca/l10n-brazil/requirements.txt
pip3 install -r oca/l10n-canada/requirements.txt
pip3 install -r oca/l10n-colombia/requirements.txt
pip3 install -r oca/l10n-costa-rica/requirements.txt
pip3 install -r oca/l10n-finland/requirements.txt
pip3 install -r oca/l10n-france/requirements.txt
pip3 install -r oca/l10n-germany/requirements.txt
pip3 install -r oca/l10n-luxemburg/requirements.txt
pip3 install -r oca/l10n-mexico/requirements.txt
pip3 install -r oca/l10n-netherlands/requirements.txt
pip3 install -r oca/l10n-spain/requirements.txt
pip3 install -r oca/l10n-switzerland/requirements.txt
pip3 install -r oca/l10n-venezuela/requirements.txt
pip3 install -r oca/management-system/requirements.txt
pip3 install -r oca/manufacture/requirements.txt
pip3 install -r oca/manufacture-reporting/requirements.txt
pip3 install -r oca/margin-analysis/requirements.txt
pip3 install -r oca/mis-builder/requirements.txt
pip3 install -r oca/multi-company/requirements.txt
pip3 install -r oca/node_modules/requirements.txt
pip3 install -r oca/operating-unit/requirements.txt
pip3 install -r oca/partner-contact/requirements.txt
pip3 install -r oca/pos/requirements.txt
pip3 install -r oca/product-attribute/requirements.txt
pip3 install -r oca/product-kitting/requirements.txt
pip3 install -r oca/product-variant/requirements.txt
pip3 install -r oca/project/requirements.txt
pip3 install -r oca/project-reporting/requirements.txt
pip3 install -r oca/purchase-reporting/requirements.txt
pip3 install -r oca/purchase-workflow/requirements.txt
pip3 install -r oca/queue/requirements.txt
pip3 install -r oca/reporting-engine/requirements.txt
pip3 install -r oca/report-print-send/requirements.txt
pip3 install -r oca/rma/requirements.txt
pip3 install -r oca/sale-financial/requirements.txt
pip3 install -r oca/sale-reporting/requirements.txt
pip3 install -r oca/sale-workflow/requirements.txt
pip3 install -r oca/server-auth/requirements.txt
pip3 install -r oca/server-backend/requirements.txt
pip3 install -r oca/server-brand/requirements.txt
pip3 install -r oca/server-env/requirements.txt
pip3 install -r oca/server-tools/requirements.txt
pip3 install -r oca/server-ux/requirements.txt
pip3 install -r oca/social/requirements.txt
pip3 install -r oca/stock-logistics-barcode/requirements.txt
pip3 install -r oca/stock-logistics-reporting/requirements.txt
pip3 install -r oca/stock-logistics-tracking/requirements.txt
pip3 install -r oca/stock-logistics-transport/requirements.txt
pip3 install -r oca/stock-logistics-warehouse/requirements.txt
pip3 install -r oca/stock-logistics-workflow/requirements.txt
pip3 install -r oca/vertical-community/requirements.txt
pip3 install -r oca/vertical-construction/requirements.txt
pip3 install -r oca/vertical-edition/requirements.txt
pip3 install -r oca/vertical-hotel/requirements.txt
pip3 install -r oca/vertical-isp/requirements.txt
pip3 install -r oca/vertical-ngo/requirements.txt
pip3 install -r oca/vertical-travel/requirements.txt
pip3 install -r oca/web/requirements.txt
pip3 install -r oca/webkit-tools/requirements.txt
pip3 install -r oca/website/requirements.txt
pip3 install -r oca/storage/requirements.txt
pip3 install -r oca/brand/requirements.txt
pip3 install -r oca/rest-framework/requirements.txt
pip3 install -r oca/connector-jira/requirements.txt
pip3 install -r oca/search-engine/requirements.txt
pip3 install -r oca/helpdesk/requirements.txt
pip3 install -r oca/product-pack/requirements.txt
pip3 install -r oca/payroll/requirements.txt
pip3 install -r oca/wms/requirements.txt
pip3 install -r it-projects-llc/e-commerce/requirements.txt
pip3 install -r it-projects-llc/pos-addons/requirements.txt
pip3 install -r it-projects-llc/access-addons/requirements.txt
pip3 install -r it-projects-llc/website-addons/requirements.txt
pip3 install -r it-projects-llc/misc-addons/requirements.txt
pip3 install -r it-projects-llc/odoo-saas-tools/requirements.txt
pip3 install -r it-projects-llc/odoo-telegram/requirements.txt
echo -e "* Starting Odoo Service"
sudo su root -c "/etc/init.d/$OE_CONFIG start"
echo "-----------------------------------------------------------"
echo "Done! The Odoo server is up and running. Specifications:"
echo "Port: $OE_PORT"
echo "User service: $OE_USER"
echo "Configuraton file location: /etc/${OE_CONFIG}.conf"
echo "Logfile location: /var/log/$OE_USER"
echo "User PostgreSQL: $OE_USER"
echo "Code location: $OE_USER"
echo "Addons folder: $OE_USER/$OE_CONFIG/addons/"
echo "Password superadmin (database): $OE_SUPERADMIN"
echo "Start Odoo service: sudo service $OE_CONFIG start"
echo "Stop Odoo service: sudo service $OE_CONFIG stop"
echo "Restart Odoo service: sudo service $OE_CONFIG restart"
if [ $INSTALL_NGINX = "True" ]; then
echo "Nginx configuration file: /etc/nginx/sites-available/odoo"
fi
echo "-----------------------------------------------------------"