Install Tryton ERP on Ubuntu 20.4

image

  1. Install apt package

apt install python3-pip

sudo apt install tryton-server

If got error with pip3 install run de following command:

sudo python -m pip uninstall pip && sudo apt install python-pip --reinstall
sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall
  1. Install Tryton dependency package via pip3
pip3 install Werkzeug wrapt lxml relatorio Genshi python-dateutil polib python-sql passlib psycopg2 pydot sphinx python-Levenshtein bcrypt html2text
  1. Install Tryton

sudo adduser --system --quiet --shell=/bin/bash --gecos ‘trytond’ --group trytond

sudo adduser trytond sudo

pip install trytond pip install tryton pip install trytond_module_name (could be found at: https://downloads.tryton.org/6.4/modules.txt )

  1. Install SAO

git clone GitHub - tryton/sao: Mirror of Tryton web client - Sao

apt install npm

npm install --production

sudo npm install -g grunt-cli --force

grunt

npm install -g bower

sudo bower install --allow-root

mkdir /etc/tryton

vi /etc/tryton/trytond.conf

[web]
listen=0.0.0.0:8000
root = /home/XXX/sao
hostname = sao.arathe.com

[database]
# uri = database://username:password@host:port/
uri=postgresql://tryton:PASSWORD@127.0.0.1:5432/tryton
path = /home/xxx/
[jsonrpc]
# Settings for the JSON-RPC network interface
data=/home/xxx/sao[web]
listen=0.0.0.0:8000
root = /home/yoda/sao
hostname = sao.arathe.com

trytond-admin -c /etc/tryton/trytond.conf -d DATABASE NAME --all

Start Trytond server ( for test)

trytond -c /etc/tryton/trytond.conf

http://docs.tryton.org/projects/server/en/latest/topics/setup_database.html

  1. Install Tryton module:

pip3 install trytond_company trytond_dashboard trytond_product trytond_product_attribute trytond_production trytond_project trytond_project_plan trytond_purchase trytond_sale trytond_stock trytond_stock_lot trytond_stock_split

  1. Start trytond at boot /etc/init.d/tryton-server or http://debian.tryton.org/gitweb/?p=packages/tryton-server.git;a=blob_plain;f=debian/tryton-server.init;hb=HEAD

vi /etc/init.d/trytond

add below line to trytond file

#!/bin/sh
### BEGIN INIT INFO
# Provides: trytond
# 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: Business Applications
### END INIT INFO
PATH=/bin:/sbin:/usr/bin
DAEMON=/usr/local/bin/trytond
NAME=trytond
DESC=trytond
# Specify the user name (Default: trytond).
USER=trytond
# Specify an alternate config file
CONFIGFILE="/etc/tryton/trytond.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


update-rc.d tryton defaults