How to install Tryton ERP on Ubuntu 18.10

  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 = XXX.gimitec.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 = xxx.gimitec.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

The way is

sudo pip3 install trytond --upgrade

sudo pip3 install tryton --upgrade

or in short

sudo pip install [package_name] -U

sudo will ask to enter your root password to confirm the action.

If you do not have a root password (if you are not the admin) you should probably work with virtualenv and then you should drop the sudo :

pip install [package_name] --upgrade
pip3 install trytond_account trytond_account_payment_sepa trytond_account_product trytond_sale_price_list trytond_account_dunning trytond_currency trytond_purchase_request trytond_sale trytond_sale_supply trytond_stock_supply trytond_account_invoice trytond_account_statement trytond_sale_subscription trytond_stock trytond_production_work_timesheet trytond_stock_package_shipping_ups trytond_stock_package_shipping_dpd trytond_production_work trytond-production-outsourcing trytond_stock_package_shipping trytond_production_routing trytond_carrier_weight trytond_carrier_percentage trytond_account_tax_rule_country trytond_stock_supply_production trytond_stock_supply_forecast  trytond_stock_location_move trytond_stock_consignment trytond_sale_supply_drop_shipment trytond_sale_stock_quantity trytond_sale_shipment_cost trytond-sale-promotion-coupon trytond_sale_advance_payment trytond_analytic_sale trytond_analytic_purchase trytond-sale-subscription-asset trytond_sale_promotion trytond_sale_extra trytond_purchase_requisition trytond-purchase-request-quotation trytond_project_invoice trytond_product_price_list_dates trytond_commission_waiting trytond_analytic_invoice trytond_account_payment_sepa_cfonb trytond_stock_supply_day trytond_sale_shipment_tolerance trytond_sale_shipment_grouping trytond_sale_payment trytond_sale_opportunity trytond_sale_invoice_grouping trytond_sale_credit_limit trytond_sale_complaint trytond_purchase_shipment_cost trytond_purchase_invoice_line_standalone trytond_project_revenue trytond_commission trytond_account_asset trytond_purchase trytond_account_stock_landed_cost_weight trytond_account_stock_anglo_saxon trytond-account-statement-ofx trytond_account_statement_coda trytond-account-statement-aeb43 trytond_account_payment_stripe trytond_account_payment_clearing trytond-account-fr-chorus trytond_account_be trytond_stock_shipment_measurements trytond_stock_product_location trytond-stock-lot-unit trytond_stock_lot_sled trytond_project_plan trytond_production_split trytond-edocument-uncefact trytond-account-tax-cash trytond_account_stock_landed_cost trytond_account_payment trytond_account_invoice_stock trytond_account_invoice_line_standalone trytond_account_invoice_history trytond_account_invoice_correction trytond_account_fr trytond_account_eu trytond_account_dunning_fee trytond_account_dunning_email trytond_account_deposit trytond_timesheet_cost trytond_stock_split trytond_stock_package trytond_stock_lot trytond_stock_location_sequence trytond_stock_inventory_location trytond_stock_forecast trytond_project trytond_production trytond-product-price-list-parent trytond_product_cost_fifo trytond_product_classification_taxonomic trytond_account_stock_continental trytond_account_dunning_letter trytond_account_credit_limit trytond_timesheet trytond_product_price_list trytond_product_measurements trytond_product_cost_history trytond_product_classification trytond_product_attribute trytond-edocument-unece trytond_customs trytond_carrier trytond_analytic_account trytond_product trytond_notification_email trytond_company_work_time trytond_web_user trytond_party_siret trytond_party_relationship trytond_google_maps trytond_company trytond_bank trytond_party trytond_ldap_authentication trytond_dashboard trytond_country trytond_authentication_sms trytond-gis --upgrade

trytond-admin -c <config file> -d <database name> --update-modules-list

trytond-admin -c /etc/tryton/trytond.conf -d XXX --update-modules-list

apt install nginx

apt start nginx

apt enable nginx

vi /etc/nginx/conf.d/trytond.conf

#
# this is the nginx config for trytond
#

upstream trytond {
    server localhost:8000;
}


server {

    # replace 'localhost' with your fqdn if you want to use trytond from remote
    server_name XXX.gimitec.com;

    root /home/XXX/sao;

    access_log /var/log/nginx/trytond.access.log;
    error_log  /var/log/nginx/trytond.error.log;

    client_max_body_size 500M;

    location ~ ^/(assets/|robots.txt|humans.txt|favicon.ico) {
        expires max;
    }    

    location / {
        proxy_set_header Host $http_host;
        proxy_set_header CLIENT_IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_read_timeout 300;
        proxy_pass http://trytond;

        gzip on;
        gzip_types text/plain text/xml text/css image/svg+xml application/javascript application/x-javascript application/json application/xml;
        gzip_proxied any;
    }

}


nginx -t

systemctl restart nginx

Install certbot

Install
On Ubuntu systems, the Certbot team maintains a PPA. You can add it to your list of repositories and install Certbot by running the following commands.

$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository universe
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install python-certbot-nginx 
Certbot's DNS plugins are also available for your system which can be used to automate obtaining a wildcard certificate from Let's Encrypt's ACMEv2 server. To use one of these plugins, you must have configured DNS for the domain you want to obtain a certificate for with a DNS provider that Certbot has a plugin for. A list of these plugins and more information about using them can be found here. To install one of these plugins, run the installation command above but replace python-certbot-nginx with the name of the DNS plugin you want to install.

Get Started
Certbot has an Nginx plugin, which is supported on many platforms, and automates certificate installation.

$ sudo certbot --nginx
Running this command will get a certificate for you and have Certbot edit your Nginx configuration automatically to serve it. If you're feeling more conservative and would like to make the changes to your Nginx configuration by hand, you can use the certonly subcommand:

$ sudo certbot --nginx certonly

https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx

sudo apt-get autoremove
sudo apt-get --purge remove && sudo apt-get autoclean
sudo apt-get -f install
sudo apt-get update
sudo apt-get upgrade && sudo apt-get dist-upgrade
sudo dpkg-reconfigure -a
sudo dpkg --configure -a

Hello,
At my site just normal run upgrade by cli:

sudo pip3 install trytond --upgrade

sudo pip3 install trytond --upgrade

 pip3 install trytond_account trytond_account_payment_sepa trytond_account_product trytond_sale_price_list trytond_account_dunning trytond_currency trytond_purchase_request trytond_sale trytond_sale_supply trytond_stock_supply trytond_account_invoice trytond_account_statement trytond_sale_subscription trytond_stock trytond_production_work_timesheet trytond_stock_package_shipping_ups trytond_stock_package_shipping_dpd trytond_production_work trytond-production-outsourcing trytond_stock_package_shipping trytond_production_routing trytond_carrier_weight trytond_carrier_percentage trytond_account_tax_rule_country trytond_stock_supply_production trytond_stock_supply_forecast  trytond_stock_location_move trytond_stock_consignment trytond_sale_supply_drop_shipment trytond_sale_stock_quantity trytond_sale_shipment_cost trytond-sale-promotion-coupon trytond_sale_advance_payment trytond_analytic_sale trytond_analytic_purchase trytond-sale-subscription-asset trytond_sale_promotion trytond_sale_extra trytond_purchase_requisition trytond-purchase-request-quotation trytond_project_invoice trytond_product_price_list_dates trytond_commission_waiting trytond_analytic_invoice trytond_account_payment_sepa_cfonb trytond_stock_supply_day trytond_sale_shipment_tolerance trytond_sale_shipment_grouping trytond_sale_payment trytond_sale_opportunity trytond_sale_invoice_grouping trytond_sale_credit_limit trytond_sale_complaint trytond_purchase_shipment_cost trytond_purchase_invoice_line_standalone trytond_project_revenue trytond_commission trytond_account_asset trytond_purchase trytond_account_stock_landed_cost_weight trytond_account_stock_anglo_saxon trytond-account-statement-ofx trytond_account_statement_coda trytond-account-statement-aeb43 trytond_account_payment_stripe trytond_account_payment_clearing trytond-account-fr-chorus trytond_account_be trytond_stock_shipment_measurements trytond_stock_product_location trytond-stock-lot-unit trytond_stock_lot_sled trytond_project_plan trytond_production_split trytond-edocument-uncefact trytond-account-tax-cash trytond_account_stock_landed_cost trytond_account_payment trytond_account_invoice_stock trytond_account_invoice_line_standalone trytond_account_invoice_history trytond_account_invoice_correction trytond_account_fr trytond_account_eu trytond_account_dunning_fee trytond_account_dunning_email trytond_account_deposit trytond_timesheet_cost trytond_stock_split trytond_stock_package trytond_stock_lot trytond_stock_location_sequence trytond_stock_inventory_location trytond_stock_forecast trytond_project trytond_production trytond-product-price-list-parent trytond_product_cost_fifo trytond_product_classification_taxonomic trytond_account_stock_continental trytond_account_dunning_letter trytond_account_credit_limit trytond_timesheet trytond_product_price_list trytond_product_measurements trytond_product_cost_history trytond_product_classification trytond_product_attribute trytond-edocument-unece trytond_customs trytond_carrier trytond_analytic_account trytond_product trytond_notification_email trytond_company_work_time trytond_web_user trytond_party_siret trytond_party_relationship trytond_google_maps trytond_company trytond_bank trytond_party trytond_ldap_authentication trytond_dashboard trytond_country trytond_authentication_sms trytond-gis --upgrade

Without any error show on log,
But after reboot server and try to access again SAO
input user name/password and, we got error as below:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 108, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 48, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/protocols/dispatcher.py", line 65, in login
    database_name, user, parameters, context=context)
  File "/trytond/security.py", line 51, in login
    session = user_id, Session.new()
  File "/trytond/ir/session.py", line 51, in new
    session, = cls.create([values])
  File "/trytond/ir/session.py", line 149, in create
    return super(Session, cls).create(vlist)
  File "/trytond/model/modelsql.py", line 159, in wrapper
    return func(cls, *args, **kwargs)
  File "/trytond/model/modelsql.py", line 675, in create
    cls._validate(sub_records)
  File "/trytond/model/modelstorage.py", line 75, in wrapper
    return func(*args, **kwargs)
  File "/trytond/model/modelstorage.py", line 1040, in _validate
    ctx_pref = User.get_preferences(context_only=True)
  File "/trytond/res/user.py", line 503, in get_preferences
    preferences = cls._get_preferences(user, context_only=context_only)
  File "/trytond/modules/stock/res.py", line 22, in _get_preferences
    preferences = super()._get_preferences(user, context_only=context_only)
  File "/trytond/modules/company_work_time/res.py", line 15, in _get_preferences
    context_only=context_only)
  File "/trytond/modules/company/company.py", line 191, in _get_preferences
    context_only=context_only)
  File "/trytond/res/user.py", line 463, in _get_preferences
    if getattr(user, field):
  File "/trytond/model/fields/field.py", line 334, in __get__
    return inst.__getattr__(self.name)
  File "/trytond/model/modelstorage.py", line 1557, in __getattr__
    read_data = self.read(list(ids), list(ffields.keys()))
  File "/trytond/modules/company/company.py", line 240, in read
    result = super(User, cls).read(ids, fields_names=fields_names)
  File "/trytond/res/user.py", line 350, in read
    result = super(User, cls).read(ids, fields_names)
  File "/trytond/model/modelsql.py", line 758, in read
    order_by=history_order, limit=history_limit))
  File "/trytond/backend/postgresql/database.py", line 68, in execute
    cursor.execute(self, sql, args)
psycopg2.errors.UndefinedColumn: column a.warehouse does not exist
LINE 1: ...e" AS "active", "a"."create_uid" AS "create_uid", "a"."wareh...
                                                             ^

Is there any method to fix this problem ? please help

Just missed to run database update by:

sudo trytond-admin -c /etc/tryton/trytond.conf -d database --update-modules-list

and

sudo trytond-admin -c /etc/tryton/trytond.conf -d database --all

Now everything working again,

Thank you,

upgrade module list by pip

su - trytond

pip3 install trytond-account trytond-account_asset trytond-account_be trytond-account_budget trytond-account_cash_rounding trytond-account_credit_limit trytond-account_deposit trytond-account_de_skr03 trytond-account_dunning trytond-account_dunning_email trytond-account_dunning_fee trytond-account_dunning_letter trytond-account_es trytond-account_es_sii trytond-account_eu trytond-account_fr trytond-account_fr_chorus trytond-account_invoice trytond-account_invoice_correction trytond-account_invoice_defer trytond-account_invoice_history trytond-account_invoice_line_standalone trytond-account_invoice_secondary_unit trytond-account_invoice_stock trytond-account_invoice_watermark trytond-account_move_line_grouping trytond-account_payment trytond-account_payment_braintree trytond-account_payment_clearing trytond-account_payment_sepa trytond-account_payment_sepa_cfonb trytond-account_payment_stripe trytond-account_product trytond-account_receivable_rule trytond-account_rule trytond-account_statement trytond-account_statement_aeb43 trytond-account_statement_coda trytond-account_statement_ofx trytond-account_statement_rule trytond-account_stock_anglo_saxon trytond-account_stock_continental trytond-account_stock_landed_cost trytond-account_stock_landed_cost_weight trytond-account_stock_shipment_cost trytond-account_stock_shipment_cost_weight trytond-account_tax_cash trytond-account_tax_non_deductible trytond-account_tax_rule_country trytond-analytic_account trytond-analytic_budget trytond-analytic_invoice trytond-analytic_purchase trytond-analytic_sale trytond-attendance trytond-authentication_sms trytond-bank trytond-carrier trytond-carrier_percentage trytond-carrier_subdivision trytond-carrier_weight trytond-commission trytond-commission_waiting trytond-company trytond-company_work_time trytond-country trytond-currency trytond-currency_ro trytond-currency_rs trytond-customs trytond-dashboard trytond-edocument_uncefact trytond-edocument_unece trytond-google_maps trytond-incoterm trytond-ldap_authentication trytond-marketing trytond-marketing_automation trytond-marketing_email trytond-notification_email trytond-party trytond-party_avatar trytond-party_relationship trytond-party_siret trytond-product trytond-product_attribute trytond-product_classification trytond-product_classification_taxonomic trytond-product_cost_fifo trytond-product_cost_history trytond-product_cost_warehouse trytond-product_image trytond-product_image_attribute trytond-product_kit trytond-production trytond-production_outsourcing trytond-production_routing trytond-production_split trytond-production_work trytond-production_work_timesheet trytond-product_measurements trytond-product_price_list trytond-product_price_list_dates trytond-product_price_list_parent trytond-project trytond-project_invoice trytond-project_plan trytond-project_revenue trytond-purchase trytond-purchase_amendment trytond-purchase_history trytond-purchase_invoice_line_standalone trytond-purchase_price_list trytond-purchase_product_quantity trytond-purchase_request trytond-purchase_request_quotation trytond-purchase_requisition trytond-purchase_secondary_unit trytond-purchase_shipment_cost trytond-sale trytond-sale_advance_payment trytond-sale_amendment trytond-sale_complaint trytond-sale_credit_limit trytond-sale_discount trytond-sale_extra trytond-sale_gift_card trytond-sale_history trytond-sale_invoice_date trytond-sale_invoice_grouping trytond-sale_opportunity trytond-sale_payment trytond-sale_point trytond-sale_price_list trytond-sale_product_customer trytond-sale_product_quantity trytond-sale_promotion trytond-sale_promotion_coupon trytond-sale_secondary_unit trytond-sale_shipment_cost trytond-sale_shipment_grouping trytond-sale_shipment_tolerance trytond-sale_stock_quantity trytond-sale_subscription trytond-sale_subscription_asset trytond-sale_supply trytond-sale_supply_drop_shipment trytond-sale_supply_production trytond-stock trytond-stock_assign_manual trytond-stock_consignment trytond-stock_forecast trytond-stock_inventory_location trytond-stock_location_move trytond-stock_location_sequence trytond-stock_lot trytond-stock_lot_sled trytond-stock_lot_unit trytond-stock_package trytond-stock_package_shipping trytond-stock_package_shipping_dpd trytond-stock_package_shipping_mygls trytond-stock_package_shipping_sendcloud trytond-stock_package_shipping_ups trytond-stock_product_location trytond-stock_quantity_early_planning trytond-stock_quantity_issue trytond-stock_secondary_unit trytond-stock_shipment_cost trytond-stock_shipment_cost_weight trytond-stock_shipment_measurements trytond-stock_split trytond-stock_supply trytond-stock_supply_day trytond-stock_supply_forecast trytond-stock_supply_production trytond-timesheet trytond-timesheet_cost trytond-user_role trytond-web_shop trytond-web_shop_shopify trytond-web_shop_vue_storefront trytond-web_shop_vue_storefront_stripe trytond-web_shortener trytond-web_user trytond tryton --upgrade

still not done by install tryton package on Ubuntu