In this post I will install sao, the Tryton web client, to use with an existing Tryton installation. If you have not installed Tryton yet you will need to start with my post Install Tryton on FreeBSD 13.
Tryton is open source business software of the type popularly known as ERP (Enterprise Resource Plannning). As described in Install Tryton on FreeBSD 13, Tryton follows a three-tier architecture model with the presentation tier consisting of one, or both, of the following:
- tryton, the Tryton desktop client.
- sao, the Tryton web client.
The Tryton desktop client was included when Tryton was first released in 2008, sao was released more recently in 2015. Lay users will likely perceive sao simply as a Tryton web app, but distingishing between the tiers will still be important for system integrators and developers as shown in the following diagram (which arguably has its’ own simplifications).
The data tier is PostgreSQL, the logic tier is trytond, and the presentation tier is the Tryton client and/or sao (the web browser is only the display for sao).
% sudo pkg install npm-node17
git will be required by npm to install sao. Install git now if it is not already installed.
% sudo pkg install git
Download the sao package from the Tryton project archive to a working directory. The version of sao downloaded must be the same as the version of trytond that is installed.
% cd ~/work % wget https://downloads.tryton.org/6.2/tryton-sao-6.2.3.tgz
For convenience, the last version of sao is also provided for convenience, the last version is updated when there is a new release.
% wget https://downloads.tryton.org/6.2/tryton-sao-last.tgz
Extract sao from the downloaded archive package, rename the extracted directory, and create a symlink for convenience in configuring trytond and for updating sao.
% cd ~/work % tar -xf ~/work/tryton-sao-6.2.3.tgz ...or... % tar -xf ~/work/tryton-sao-last.tgz % mv package sao-6.2.3 % ln -s sao-6.2.3 sao
Install sao following the instructions in the extracted README.md file.
% cd sao % npm install --production --legacy-peer-deps
You may notice some ominous warnings regarding grunt-xgettext and grunt-po2json during installation, but they can safely be ignored. These packages are required only for development, they are not involved in the running of sao (like all the devDependencies).
npm WARN firstname.lastname@example.org requires a peer of grunt@~0.4.5 but none is installed. You must install peer dependencies yourself. npm WARN email@example.com requires a peer of grunt@~0.4.1 but none is installed. You must install peer dependencies yourself.
trytond reads a trytond.conf configuration file to set operating conditions. Edit ~/work/trytond/trytond.conf to specify the location of sao.
[web] listen=0.0.0.0:8000 root = /home/dale/work/sao
Starting trytond within a tmux session will prevent trytond from being terminated if the ssh connection to the server is broken. In other words, you can safely break your ssh connection to the server and trytond will stay running. Also the notices that are output by trytond to the shell can be reviewed after re-connecting.
(env) dale@starlord:~/work/trytond$ tmux (env) dale@starlord:~/work/trytond$ env/bin/trytond -v -c ./trytond.conf -d test_db 25690 34374492160 [2022-01-19 20:16:19,365] WARNING werkzeug * Running on all addresses. WARNING: This is a development server. Do not use it in a production deployment. 25690 34374492160 [2022-01-19 20:16:19,366] INFO werkzeug * Running on http://10.0.2.15:8000/ (Press CTRL+C to quit)
Connect to Tryton web app
Start a web browser and connect to the Tryton server URL with the assigned port.
trytond listens on port 8000, ensure the port is open and or forwarded if you are using a virtual machine.
Login with a valid user name and password, such as the admin user and password entered when the database was initialized. The rendered sao interface is essentially identical to the Tryton desktop client (as much as is possible).