Advices or good practices when developping multiple custom modules...

31 views
Skip to first unread message

Maxime Richez

unread,
Dec 12, 2017, 7:52:35 AM12/12/17
to tryton-dev
During TUL2017, i could see the structure of Jurassic Fruit website using tryton.
All the content was in one directory with the customization of the different modules in sub-directories...

Could we have a small example of such structure and what should be written in tryton.cfg, __init__.py files ?

Is there only one repository for the whole project? Or has any subdirectory his own repository ? (and some exclusion in the parent repository not to include the sub-directory)

I saw also some files or directory named "issuexxx". Could you explain this way of working ?

Thanks !

Nicolas Évrard

unread,
Dec 12, 2017, 8:13:19 AM12/12/17
to tryton-dev
* Maxime Richez [2017-12-12 13:52 +0100]:
>During TUL2017, i could see the structure of Jurassic Fruit website
>using tryton.
>All the content was in one directory with the customization of the
>different modules in sub-directories...
>
>Could we have a small example of such structure and what should be
>written in tryton.cfg, __init__.py files ?

directory structure:

trytond
+ modules
+ …
+ my_client_name
- __init__.py
- tryton.cfg
+ my_feature
- __init__.py

+ another_feature
- __init__.py
- …

tryton.cfg:

The usual tryton.cfg file except for the [xml] section

[xml]
my_feature/blabla.xml
another_feature/brol.xml

__init__.py:

from . import my_feature
from . import another_feature

def register():
Pool.register(…)

my_feature.register('my_client_name')
another_feature('my_client_name')

Into each feature there is a __init__.py which does the importation
and registration of the Tryton models. The register method takes an
argument (that way a directory could be copied somewhere else and
called with another name).

>Is there only one repository for the whole project? Or has any
>subdirectory his own repository ? (and some exclusion in the parent
>repository not to include the sub-directory)

We use only one repository.

>I saw also some files or directory named "issuexxx". Could you
>explain this way of working ?

It's used when we backport some features / fixes from a specific issue
on the tryton bug tracker.

--
Nicolas Évrard - B2CK SPRL
E-mail/Jabber: nicolas...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Sergi Almacellas Abellana

unread,
Dec 12, 2017, 8:27:38 AM12/12/17
to tryto...@googlegroups.com
El 12/12/17 a les 13:52, Maxime Richez ha escrit:
> All the content was in one directory with the customization of the different modules in sub-directories...
Indeed this is possible to do via entry points. So you have one
repository, with one folder for each module. Then you define a setup.py
for the repository which installs all the modules, but you can activate
the ones you want depending on the database.

If somebody is interested, an example can be found on the kalensis project:

https://bitbucket.org/kalenis/kalenislims/src/46ae88ada935934103c9f87460236cf34173298d/setup.py?at=default&fileviewer=file-view-default#setup.py-43

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Maxime Richez

unread,
Dec 12, 2017, 10:55:28 AM12/12/17
to tryton-dev
Thanks!

Reply all
Reply to author
Forward
0 new messages