Pritish Chakraborty

Work and Everything Else

Beginning Tryton

Before we go through the setup of the Tryton client and server, one should go through setting up the virtualenv and postgres. Also, install libxslt-dev (and perhaps libz-dev as well) with your package manager because the lxml package needs it.

Right, now let’s activate our virtualenv and install the requisite packages.

installing tryton/trytond
1
2
3
4
$ workon trytonenv
$ pip install trytond trytond-party trytond-company trytond-country trytond-currency
$ pip install tryton
$ pip install psycopg2 # Required for DB connectivity.

The packages that follow trytond are Tryton modules. trytond is the server and tryton is the client. Any server needs a configuration file, and we have one for ours too. Picked up from the Gentoo wiki -:

sample trytond.conf (trytond.conf) download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#This file is part of Tryton.  The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
[options]

# Activate the json-rpc protocol
jsonrpc = *:8000
#ssl_jsonrpc = False

# This is the hostname used when generating tryton URI
#hostname_jsonrpc =

# Configure the path of json-rpc data
#jsondata_path = /var/www/localhost/tryton

# Activate the xml-rpc protocol
#xmlrpc = *:8069
#ssl_xmlrpc = False

# Activate the webdav protocol
#webdav = *:8080
#ssl_webdav = False

# This is the hostname used when generating WebDAV URI
#hostname_webdav =

# Configure the database type
# allowed values are postgresql, sqlite, mysql
db_type = postgresql

# Configure the database connection
## Note: Only databases owned by db_user will be displayed in the connection dialog
## of the Tryton client. db_user must have create permission for new databases
## to be able to use automatic database creation with the Tryton client.
db_host = localhost
db_port = 5432
db_user = postgres
db_password = dbpassword
db_minconn = 1
db_maxconn = 64

# Configure the postgresql path for the executable
#pg_path = None

# Configure the Tryton server password
admin_passwd = admin

# Configure the path of the files for the pid and the logs
#pidfile = False
#logfile = False

#privatekey = server.pem
#certificate = server.pem

# Configure the SMTP connection
#smtp_server = localhost
#smtp_port = 25
#smtp_ssl = False
#smtp_tls = False
#smtp_password = False
#smtp_user = False

# Configure the path to store attachments and sqlite database
#data_path = /var/lib/trytond

# Allow to run more than one instance of trytond
#multi_server = False

# Configure the session timeout (inactivity of the client in sec)
#session_timeout = 600

# Enable auto-reload of modules if changed
#auto_reload = True

# Prevent database listing
#prevent_dblist = False

# Enable cron
# cron = True

# unoconv connection
#unoconv = pipe,name=trytond;urp;StarOffice.ComponentContext

# Number of retries on database operational error
# retry = 5

# Default database language code
# language = en_US
language = es_ES

# Timezone of the server
# timezone = False

You might want to change the value of the db_password field there, to the pass that you had set for the postgres role earlier. You will be using this pass to login to a database in Tryton.

Now, fire up two terminal windows or tabs, and run the following commands separately in each -:

tryton start
1
2
$ trytond -c path/to/trytond.conf
$ tryton -dv

The -dv switch will allow you to see errors and other messages on the command line for the Tryton client in a verbose manner.

You will arrive at a screen to login to the demo profile. Close that, and head to File->Database->New Database. Note that the default administrator password for Tryton is admin. Here, the admin_passwd field has been inserted to change the default. One could remove this field if they wished.

Congratulations, you’ve created your very first Tryton database. Now you can login to it and install the necessary Tryton modules.

Comments