The productivity/tryton/5.2/trytond port

trytond-5.2.20p4 – 3-tiers general purpose business application framework (cvsweb github mirror)


The server of the Tryton application platform.
A three-tiers  high-level general purpose application platform
written in Python and use Postgresql as main database engine.
It is the core base of an Open Source ERP.
It provides modularity, scalability and security.
WWW: https://www.tryton.org/


| Running ${PKGSTEM} on OpenBSD

PostgreSQL is the recommended daemon for production usage. Trytond has support
for SQLite too, but intended only for testing purpose.

PostgreSQL configuration

System starting ordering
Trytond daemon should be started AFTER database daemon.
When postgresql is used, the following commands are needed:

	# rcctl enable postgresql trytond
	# rcctl order postgresql trytond

Creating a postgresql user for tryton

	# su _postgresql -c "createuser -U postgres -P tryton_user"
	Enter password for new role: tryton_user-password
	Enter it again: ...
	Password: postgres-password

When postgresql and trytond are on the same host, the config file of trytond
should contains:

	uri = postgresql://tryton_user:tryton_user-password@/

Note that if the password contains special characters, it should be urlencoded.

Creating a new tryton database on PostgreSQL

The database should be created using createdb(1) tool from postgresql.

	# su _postgresql -c "createdb -U postgres -O tryton_user -E UTF8 mydatabase1"
	Password: postgres-password

And it should be initialized with trytond-admin(1) tool from trytond, after the
configuration file has been configured.

Trytond configuration


trytond comes with 3 rcscripts:

- trytond : trytond server listening on HTTP
- trytond_cron : trytond cron service
- trytond_worker : trytond asynchronous task service
  (see http://doc.tryton.org/projects/trytond/en/${TRYTON_VERSION}/topics/configuration.html#worker)

Useful flags on rcscript are:

- configuration file : `--config FILE [ FILE ...]`
- logging configuration file (ConfigParser format) : `--logconf FILE`
- database name to use : `--database DATABASE [DATABASE ...]`

By default, configuration file is at ${SYSCONFDIR}/trytond/server.conf and
logging configuration at ${SYSCONFDIR}/trytond/logging.conf .

Please note that `--database` is required for trytond_cron and trytond_worker,
else the daemons won't know which databases to monitor and they will do

	# rcctl set trytond flags $(rcctl getdef trytond flags) --database mydatabase1
	# rcctl set trytond_cron flags $(rcctl getdef trytond_cron flags) --database mydatabase1
	# rcctl set trytond_worker flags $(rcctl getdef trytond_worker flags) --database mydatabase1

Configuration file

See http://doc.tryton.org/projects/trytond/en/${TRYTON_VERSION}/topics/configuration.html for documentation.

Database initialisation

Once the configuration file configured, you could initialize the database using:

	# su _trytond -c "trytond-admin -v -c /etc/trytond/server.conf -d mydatabase1 --all"

it will ask you for admin email and password, and configure the database
accordingly. Please note that the database should be created first.

For more details, see http://doc.tryton.org/projects/trytond/en/${TRYTON_VERSION}/topics/setup_database.html

Trytond upgrade

For more details, see http://doc.tryton.org/projects/trytond/en/${TRYTON_VERSION}/topics/setup_database.html#update-a-database

Minor upgrade

You should update the modules information registered in database using
filesystem information.

	# su _trytond -c "trytond-admin -v -c /etc/trytond/server.conf -d mydatabase1 --update-modules-list"

And next, start the upgrade of the modules.

	# su _trytond -c "trytond-admin -v -c /etc/trytond/server.conf -d mydatabase1 --all"

Major upgrade

Upgrade path is possible from N to N+1 version.

Follow indications at https://discuss.tryton.org/c/migration .

Please note some actions may require to be done BEFORE updating.

Customization via trytond modules

Customization on Tryton is expected to be done via installation of modules.

To easy inclusion of local modules without installing them at system level, the
recommended way is to use the per-user site-packages directory (PEP-370). For
the default user used for running `trytond` daemon (`_trytond` user), the
directory is at `${LOCALSTATEDIR}/trytond/.local/lib/python${MODPY_VERSION}/site-packages/`.

To keep proper control on read-write directories used by `_trytond` user, you
should make the `site-packages` directory writeable only for you (and readable
by `_trytond`). As root, you could do the following:

	# chown user ${LOCALSTATEDIR}/trytond/.local/

Next, when installing a new module as user, you could temporary change the
`HOME` environment variable to run the install command.

Example of installing a module from local directory, using `setuptools`:

	$ cd path/to/my-local-tryton-module
	$ HOME=${LOCALSTATEDIR}/trytond python${MODPY_VERSION} ./setup.py install --user

or installing a module using pip${MODPY_VERSION} (installable from ports):

	$ cd path/to/my-local-tryton-module
	$ HOME=${LOCALSTATEDIR}/trytond pip${MODPY_VERSION} install --user .

	$ HOME=${LOCALSTATEDIR}/trytond pip${MODPY_VERSION} install --user my-module


Sebastien Marie


lang/python productivity productivity/tryton

Build dependencies

Run dependencies

Test dependencies

Reverse dependencies