Using proteus to browse / edit / .. tryton's data


Going to be using this blog post to add bits and pieces of how to use proteus to handle data in tryton.

Just noticed the proteus readme is quite good: here's a link to the proteus github

IMPORTANT: One thing I noticed (the hard way) is that if you are connected with a proteus session and you add&activate a module (at least when it is not done using proteus) you need to re-connect as it does not seem to add things like extra fields added to models otherwise.

First thing: connect:

from proteus import config, Model, Wizard, Report
pcfg = config.set_trytond(database='trytond', config_file='/etc/tryton/trytond.conf')

Then we just get ourselved our parties:

Party = Model.get('')
for p in all_parties:

This will print out all names and the first full address of each.

Party Relations (a seperate module):


Would give you output similar to this (if there are relations - in my case 2):


Interesting fields there (for me):

p.relations[0] # returns the name of the relation as entered
p.relations[0].reverse # reverse relation as entered
# the next 2 are self explainatory anyway just note the '_' with from

Now to add a new one:

np = Party()'Test Customer from Proteus'

This just creates a new party with just a name. default values that are set up (like default language) are set. Until it is saved the id ( is -1. By default it also comes with one (empty address).

Here's how to edit/add:

np.addresses[0].zip='1234''2345') # don't forget this

Extra fields from other (possibly own) can be accessed exactly the same way as the normal ones (just don't forget to reconnect - like i did ;) )

Here's how you refresh the data:



Current rating: 5


There are currently no comments

New Comment


required (not published)