Building a Tryton Server

I will be creating a new Ubuntu 20.04 LTS virtual machine using VirtualBox on FreeBSD, and install Tryton using the Docker container provided by the Tryton project. Of course there are other options.

Create Virtual Machine

Install Ubuntu 20.04 using the Ubuntu distribution DVD ISO and using the startup wizard configure appropriately.

Copy your user ssh key to the new server and disable password login.

Configure vm port forwarding.  Port forwarding with VirtualBox must be done with the vm powered off.

Name: ssh
Protocol: TCP
Host Port: 8000
Guest Port: 8000

Update Server OS

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade

Install Docker

$ sudo apt install docker.io

Install Tryton

$ sudo docker pull tryton/tryton

Start a PostgreSQL instance

The Tryton image will be pulled from library/postgres

$ sudo docker run --name tryton-postgres -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_DB=tryton -d postgres

Setup the database

$ sudo docker run --link tryton-postgres:postgres -e DB_PASSWORD=mysecretpassword -it tryton/tryton trytond-admin -d tryton --all

The script will prompt for:

  • “admin” email for “tryton”
  • “admin” password for “tryton”

Store the password in a key vault for safe future reference.

Start Tryton Instance

$ sudo docker run --name tryton -p 8000:8000 --link tryton-postgres:postgres -e DB_PASSWORD=mysecretpassword -d tryton/tryton

Start Tryton cron Instance

$ sudo docker run --name tryton-cron --link tryton-postgres:postgres -e DB_PASSWORD=mysecretpassword -d tryton/tryton trytond-cron -d tryton

Create bash Startup Script

Without further configuration the Docker container will not start automatically when the server starts. While it is possible to configure Tryton to automatically start, I have created a simple bash script for convenience to start Tryton manually.

dale@starlord:~$ cat start-tryton.sh
#!/bin/bash
# run using sudo
docker start tryton-postgres tryton tryton-cron
dale@starlord:~$

Install Tryton Modules

Modules are installed using the Tryton client, either the native client or the web client.

Login into Tryton as the admin user and access the menu: Administration > Modules > Modules. Mark the following modules for install (double-click in the Mark for Install column):

  • account
  • product
  • production
  • project
  • purchase
  • sale
  • stock

(other modules will be included automatically if they are dependencies)

To install the marked modules, either:

  • Select Launch Action icon in the Modules menu bar and then Perform Pending Installation/Upgrade, or
  • Execute the Perform Pending Installation/Upgrade Wizard from the main Tryton menu.

After the install/upgrade completes, the Module Configuration wizard runs and will query you to configure the installed modules.

Create a Company

A company is a type of ‘party’. To identify a party as a company in a new database you must first create a new party, then select it as the new company.

  • Name
    • Swift Construction Company
  • Addresses
    • Name: Default
    • Street: 1 Swift Way
    • Zip: 13054
    • City: Shopton
    • Country: United States
    • Subdivision: New York
  • Language
    • English

Configure the Company

  • Enter Company > Currency
    • US Dollar
  • On the Company > Employees > Party view
    • select the new company (e.g. Swift Construction Company)
    • select Add

Create a Chart of Accounts

  • Company: Swift Construction Company
  • Account Template: Minimal Account Chart
  • Create Default Properties
    • Default Receivable Account: Main Receivable
    • Default Payable Account: Main Payable

You will need to reload the menu in the Tryton client if it isn’t now displaying menu choices for the new modules (i.e. access menu: User > Menu Reload (Ctrl-T).

The Tryton server has been installed and you can connect to it from a Tryton client. You have also created a new Tryton database with the modules necessary to implement Maestro workflows.

Other Stuff

Command arguments

if COMMAND starts with a -, it is appended as argument to the default COMMAND. To see all arguments available run:

$ sudo docker run --rm -ti tryton/tryton --help

References

 

One Reply to “Building a Tryton Server”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.