Open Source ERP Solutions, Part Four: Tryton

Today I am going to be taking a look at the open source business solution Tryton. According to tryton.org, “TRYTON is business software, ideal for companies of any size, easy to use, complete and 100% Open Source.”

Tryton runs a pretty modular setup which has a server (PostgreSQL only), desktop client, and web client. I’m going to start by setting up the server and desktop client, and later will try out the web based client.

Installation

There are various installation options available, but I am going to install the server and client using Ubuntu’s package manager, sudo apt install tryton-server tryton-client.

Setup

After installation, tryton server appears to be up and running:

sudo service tryton-server status
 ● tryton-server.service - Tryton Server WSGI App
    Loaded: loaded (/lib/systemd/system/tryton-server.service; enabled; vendor preset: enabled)
    Active: active (running) since Thu 2019-10-17 13:03:56 MDT; 13s ago
      Docs: man:trytond,file:/usr/share/doc/tryton-server,file:/usr/share/doc/tryton-server-doc,http:doc/tryton.org/
  Main PID: 18124 (trytond)
     Tasks: 1 (limit: 4915)
    CGroup: /system.slice/tryton-server.service
            └─18124 /usr/bin/python3 /usr/bin/trytond --config /etc/tryton/trytond.conf --logconf /etc/tryton/trytond_l

You will need to have PostgreSQL installed before configuring Tryton to use it. Here is a step-by-step tutorial on getting it setup in Ubuntu 18.04 & 16.04.


To get tryton configured to use PostgreSQL, you will need to edit the daemon conf file at /etc/tryton/trytond.conf. I am just going to use the default settings by uncommenting line 47:

uri = postgresql://tryton:tryton@localhost:5432/

After changing the config, you will need to restart the trytond service:

sudo service tryton-server restart

Next, I am going to create the tryton user. The username and password need to match what you’ve selected for line 47 in the trytond.conf file:

su - postgres
createuser --interactive --pwprompt
Enter name of role to add: tryton
Enter password for new role: <tryton>
Enter it again: <tryton>
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n

With our tryton user created, we can move on to database creation. We will create the database, and grant all access to our new tryton user.

psql
CREATE DATABASE tryton;
GRANT ALL PRIVILEGES ON DATABASE tryton TO tryton;

After user and database setup, we will be able to initialize the tryton database (more details here). You’ll want to log out of the postgres user to run the following.

sudo trytond-admin -c /etc/tryton/trytond.conf -d tryton --all
"admin" password for "tryton": <password for your admin user> 
"admin" password confirmation: <password for your admin user again>

Now I can access the trytond backend using the tryton client by running tryton from the command line.

Tryton client

You will need to set up a profile in order to connect to the tryton server. Here’s how I configured mine:

After connecting, you will be walked through module configuration, including setting up some users:

The desktop client feels a bit dated and relatively inefficient, so rather than reviewing the desktop client, I’m going to move on to taking a look at the web client as I believe it will be a more modern experience.

tryton-sao

https://www.npmjs.com/package/tryton-sao

We are going to clone the sao repo and build it.

git clone https://github.com/tryton/sao.git
cd sao
# my setup required me to install npx
npm i npx
npm install --production
grunt

You will need to modify /etc/tryton/trytond.conf under the [web] section to point at this directory (wherever you create it). In my setup, I modify lines 18 and 29 to read:

# line 18
listen = 0.0.0.0:8080
# line 29
root = /home/andy/sao

Now, restart the tryton server (sudo service tryton-server restart) and you should be able to access http://localhost:8080. You should see a login screen.

Possibly due to some error along the way, but any time I try to navigate to a new menu item, I am greeted with an error which I can dismiss and continue to use the application:

Update: as pointed out by one of the developers of Tryton, Cédric Krier, the error I am receiving is due to a version mismatch between the frontend and the server.

The clients and the server must always be from the same series (the two first number of the release number).

Cédric Krier

The web interface appears to be a clone of the desktop client. I had been hoping that it would offer a more user friendly frontend experience than the desktop client. Both clients share an expandable list driven interface.

Conclusion

Ultimately I believe that Tryton may be great to use as a basis for building your own ERP, and that perhaps is what the developers intended. The out-of-the-box offerings for this open source business solution, in comparison with others, aren’t enough for me to spool up Tryton for a client.

Facebook
X
LinkedIn
Pinterest