Because I keep forgetting stuff I need to do (or the order) here a very quick overview:
Install trytond, modules + deps (on gentoo add the tryton overlay and just emerge)
If you don'T use sqlite create a user (and database) for tryton.
Gentoo Init scripts use /etc/conf.d/trytond (here's mine):
# Location of the configuration file
CONFIG=/etc/tryton/trytond.conf
# Location of the logging configuration file
LOGCONF=/etc/tryton/logging.conf
# The database names to load (space separated)
DATABASES=tryton
since it took me a while to find a working logging.conf example here's my working one:
[formatters]
keys=simple
[handlers]
keys=rotate,console
[loggers]
keys=root
[formatter_simple]
format=%(asctime)s] %(levelname)s:%(name)s:%(message)s
datefmt=%a %b %d %H:%M:%S %Y
[handler_rotate]
class=handlers.TimedRotatingFileHandler
args=('/var/log/trytond/trytond.log', 'D', 1, 120)
formatter=simple
[handler_console]
class=StreamHandler
formatter=simple
args=(sys.stdout,)
[logger_root]
level=INFO
handlers=rotate,console
(Not going into details here, if you want to know more there are plenty of resources online)
As for config I went and got an example online (from open Suse) and modified it:
# /etc/tryton/trytond.conf - Configuration file for Tryton Server (trytond)
#
# This file contains the most common settings for trytond (Defaults
# are commented).
# For more information read
# /usr/share/doc/trytond-<version>/
[database]
# Database related settings
# The URI to connect to the SQL database (following RFC-3986)
# uri = database://username:password@host:port/
# (Internal default: sqlite:// (i.e. a local SQLite database))
#
# PostgreSQL via Unix domain sockets
# (e.g. PostgreSQL database running on the same machine (localhost))
#uri = postgresql://tryton:tryton@/
#
#Default setting for a local postgres database
#uri = postgresql:///
#
# PostgreSQL via TCP/IP
# (e.g. connecting to a PostgreSQL database running on a remote machine or
# by means of md5 authentication. Needs PostgreSQL to be configured to accept
# those connections (pg_hba.conf).)
#uri = postgresql://tryton:tryton@localhost:5432/
uri = postgresql://tryton:mypassword@localhost:5432/
# The path to the directory where the Tryton Server stores files.
# The server must have write permissions to this directory.
# (Internal default: /var/lib/trytond)
path = /var/lib/tryton
# Shall available databases be listed in the client?
#list = True
# The number of retries of the Tryton Server when there are errors
# in a request to the database
#retry = 5
# The primary language, that is used to store entries in translatable
# fields into the database.
#language = en_US
language = de_AT
[ssl]
# SSL settings
# Activation of SSL for all available protocols.
# Uncomment the following settings for key and certificate
# to enable SSL.
# The path to the private key
#privatekey = /etc/ssl/private/ssl-cert-snakeoil.key
# The path to the certificate
#certificate = /etc/ssl/certs/ssl-cert-snakeoil.pem
[jsonrpc]
# Settings for the JSON-RPC network interface
# The IP/host and port number of the interface
# (Internal default: localhost:8000)
#
# Listen on all interfaces (IPv4)
listen = 0.0.0.0:8000
#
# Listen on all interfaces (IPv4 and IPv6)
#listen = [::]:8000
# The hostname for this interface
#hostname =
# The root path to retrieve data for GET requests
#data = jsondata
[xmlrpc]
# Settings for the XML-RPC network interface
# The IP/host and port number of the interface
#listen = localhost:8069
[webdav]
# Settings for the WebDAV network interface
# The IP/host and port number of the interface
#listen = localhost:8080
listen = 0.0.0.0:8080
[session]
# Session settings
# The time (in seconds) until an inactive session expires
timeout = 3600
# The server administration password used by the client for
# the execution of database management tasks. It is encrypted
# using using the Unix crypt(3) routine. A password can be
# generated using the following command line (on one line):
# $ python -c 'import getpass,crypt,random,string; \
# print crypt.crypt(getpass.getpass(), \
# "".join(random.sample(string.ascii_letters + string.digits, 8)))'
# Example password with 'admin'
#super_pwd = jkUbZGvFNeugk
super_pwd = <your pwd>
[email]
# Mail settings
# The URI to connect to the SMTP server.
# Available protocols are:
# - smtp: simple SMTP
# - smtp+tls: SMTP with STARTTLS
# - smtps: SMTP with SSL
#uri = smtp://localhost:25
uri = smtp://localhost:25
# The From address used by the Tryton Server to send emails.
from = tryton@<your-domain.tld>
[report]
# Report settings
# Unoconv parameters for connection to the unoconv service.
#unoconv = pipe,name=trytond;urp;StarOffice.ComponentContext
# Module settings
#
# Some modules are reading configuration parameters from this
# configuration file. These settings only apply when those modules
# are installed.
#
#[ldap_authentication]
# The URI to connect to the LDAP server.
#uri = ldap://host:port/dn?attributes?scope?filter?extensions
# A basic default URL could look like
#uri = ldap://localhost:389/
[web]
# Path for the web-frontend
#root = /usr/lib/node-modules/tryton-sao
listen = 0.0.0.0:8000
root = /usr/share/sao
Set up the database tables, modules, superuser
trytond-admin -c /etc/tryton/trytond.conf -d tryton --all
Should you forget to set your superuser password (or need to change it later):
trytond-admin -c /etc/tryton/trytond.conf -d tryton -p
It's now time to connect a client to it and enable & configure the modules (make sure to finish the basic configuration (including accounts,..) otherwise you have to either restart, or know what exactly needs to be set up accounting wise !
during this you can watch trytond.log to see what happens behind the scenes (e.g. country module takes a while,..)
How to add languages:
If you install new modules or languages run trytond-admin ... --all again (see above)
UPDATE (2020-12):
Country and currency data is no longer imported automatically (since version ..)
you now have to run this:
https://github.com/tryton/country
Because I keep forgetting stuff I need to do (or the order) here a very quick overview:
Install trytond, modules + deps (on gentoo add the tryton overlay and just emerge)
If you don'T use sqlite create a user (and database) for tryton.
Gentoo Init scripts use /etc/conf.d/trytond (here's mine):
# Location of the configuration file
CONFIG=/etc/tryton/trytond.conf
# Location of the logging configuration file
LOGCONF=/etc/tryton/logging.conf
# The database names to load (space separated)
DATABASES=tryton
since it took me a while to find a working logging.conf example here's my working one:
[formatters]
keys=simple
[handlers]
keys=rotate,console
[loggers]
keys=root
[formatter_simple]
format=%(asctime)s] %(levelname)s:%(name)s:%(message)s
datefmt=%a %b %d %H:%M:%S %Y
[handler_rotate]
class=handlers.TimedRotatingFileHandler
args=('/var/log/trytond/trytond.log', 'D', 1, 120)
formatter=simple
[handler_console]
class=StreamHandler
formatter=simple
args=(sys.stdout,)
[logger_root]
level=INFO
handlers=rotate,console
(Not going into details here, if you want to know more there are plenty of resources online)
As for config I went and got an example online (from open Suse) and modified it:
# /etc/tryton/trytond.conf - Configuration file for Tryton Server (trytond)
#
# This file contains the most common settings for trytond (Defaults
# are commented).
# For more information read
# /usr/share/doc/trytond-<version>/
[database]
# Database related settings
# The URI to connect to the SQL database (following RFC-3986)
# uri = database://username:password@host:port/
# (Internal default: sqlite:// (i.e. a local SQLite database))
#
# PostgreSQL via Unix domain sockets
# (e.g. PostgreSQL database running on the same machine (localhost))
#uri = postgresql://tryton:tryton@/
#
#Default setting for a local postgres database
#uri = postgresql:///
#
# PostgreSQL via TCP/IP
# (e.g. connecting to a PostgreSQL database running on a remote machine or
# by means of md5 authentication. Needs PostgreSQL to be configured to accept
# those connections (pg_hba.conf).)
#uri = postgresql://tryton:tryton@localhost:5432/
uri = postgresql://tryton:mypassword@localhost:5432/
# The path to the directory where the Tryton Server stores files.
# The server must have write permissions to this directory.
# (Internal default: /var/lib/trytond)
path = /var/lib/tryton
# Shall available databases be listed in the client?
#list = True
# The number of retries of the Tryton Server when there are errors
# in a request to the database
#retry = 5
# The primary language, that is used to store entries in translatable
# fields into the database.
#language = en_US
language = de_AT
[ssl]
# SSL settings
# Activation of SSL for all available protocols.
# Uncomment the following settings for key and certificate
# to enable SSL.
# The path to the private key
#privatekey = /etc/ssl/private/ssl-cert-snakeoil.key
# The path to the certificate
#certificate = /etc/ssl/certs/ssl-cert-snakeoil.pem
[jsonrpc]
# Settings for the JSON-RPC network interface
# The IP/host and port number of the interface
# (Internal default: localhost:8000)
#
# Listen on all interfaces (IPv4)
listen = 0.0.0.0:8000
#
# Listen on all interfaces (IPv4 and IPv6)
#listen = [::]:8000
# The hostname for this interface
#hostname =
# The root path to retrieve data for GET requests
#data = jsondata
[xmlrpc]
# Settings for the XML-RPC network interface
# The IP/host and port number of the interface
#listen = localhost:8069
[webdav]
# Settings for the WebDAV network interface
# The IP/host and port number of the interface
#listen = localhost:8080
listen = 0.0.0.0:8080
[session]
# Session settings
# The time (in seconds) until an inactive session expires
timeout = 3600
# The server administration password used by the client for
# the execution of database management tasks. It is encrypted
# using using the Unix crypt(3) routine. A password can be
# generated using the following command line (on one line):
# $ python -c 'import getpass,crypt,random,string; \
# print crypt.crypt(getpass.getpass(), \
# "".join(random.sample(string.ascii_letters + string.digits, 8)))'
# Example password with 'admin'
#super_pwd = jkUbZGvFNeugk
super_pwd = <your pwd>
[email]
# Mail settings
# The URI to connect to the SMTP server.
# Available protocols are:
# - smtp: simple SMTP
# - smtp+tls: SMTP with STARTTLS
# - smtps: SMTP with SSL
#uri = smtp://localhost:25
uri = smtp://localhost:25
# The From address used by the Tryton Server to send emails.
from = tryton@<your-domain.tld>
[report]
# Report settings
# Unoconv parameters for connection to the unoconv service.
#unoconv = pipe,name=trytond;urp;StarOffice.ComponentContext
# Module settings
#
# Some modules are reading configuration parameters from this
# configuration file. These settings only apply when those modules
# are installed.
#
#[ldap_authentication]
# The URI to connect to the LDAP server.
#uri = ldap://host:port/dn?attributes?scope?filter?extensions
# A basic default URL could look like
#uri = ldap://localhost:389/
[web]
# Path for the web-frontend
#root = /usr/lib/node-modules/tryton-sao
listen = 0.0.0.0:8000
root = /usr/share/sao
Set up the database tables, modules, superuser
trytond-admin -c /etc/tryton/trytond.conf -d tryton --all
Should you forget to set your superuser password (or need to change it later):
trytond-admin -c /etc/tryton/trytond.conf -d tryton -p
It's now time to connect a client to it and enable & configure the modules (make sure to finish the basic configuration (including accounts,..) otherwise you have to either restart, or know what exactly needs to be set up accounting wise !
during this you can watch trytond.log to see what happens behind the scenes (e.g. country module takes a while,..)
How to add languages:
If you install new modules or languages run trytond-admin ... --all again (see above)
UPDATE (2020-12):
Country and currency data is no longer imported automatically (Version 5.4)
you now have to run these 2 commands for that:
trytond_import_currencies -c /etc/tryton/trytond.conf -d tryton
trytond_import_countries -c /etc/tryton/trytond.conf -d tryton
On a side note.. this cannot be done before those 2 modules are activated. So i recommend connecting with the client, activating those 2 modules, then running the scripts and after that adding company,..
Share on Twitter Share on Facebook
Comments
There are currently no comments
New Comment