How to write a hello world code


(smit mehta) #1

somebody can help me…??? where to start learning tryton


(smit mehta) #2

Hello,i am a beginner in trytond and i am little bit confused how to code in tryton and run it…


(Sergi Almacellas Abellana) #3

There is no hello world module to tryton but you can write a model with a single field to start. In order to do this you should start by writing a module to add some functionalities on the application, have a look at:

http://doc.tryton.org/4.6/trytond/doc/topics/modules/index.html#topics-modules

Once you have the basic structure, you should create a python file which adds the model and the fields. Then you should create some views from the model as explained on:

http://doc.tryton.org/4.6/trytond/doc/topics/views/index.html#topics-views


(Cédric Krier) #4

There is also this presentation. It may be a little bit old but most of the concepts should still be valid.


(smit mehta) #5

let me know how to run the module


(smit mehta) #6

my model sturcture
/hello
—/hello
------/hello.py
------/init.py
------/tryton.cfg
------/hello.xml


(Cédric Krier) #7

You do not run module directly, you have to have it under the trytond/modules directory or installed by an entrypoint [trytond.modules]. Then you have to activate the module for a database using the trytond-admin command and run the server as usual.