Newsletter February 2019

Tryton continues its road of improvements for more performance and more scaling.

Contents:

Changes For The User

The arrows on columns are now always synchronized with the actual order. If the order is not on a single column then all arrows are displayed.

The records created by XML files in modules are by default protected against modification and deletion. But if they have the attribute noupdate set, they can be modified. Now they can also be deleted and updating the database will not recreate them.

On the wizard that allows to pay multiple lines at once, we added back a field to define the date of the payment.

Refining a search in a long list can lead to no results on the actual page of the pagination.
This can be astonishing and annoying because the user may think that there is no result at all. To prevent this, now the client automatically reduces the pagination until it finds a result.

New Modules

account_statement_rule

The module allows rules to be defined to complete statement lines from imported files. When the “Apply Rule” button is clicked on a statement, each rule is tested in order, against each origin that does not have any lines, until one is found that matches. Then the rule found is used to create the statement lines linked to the origin. Get the account_statement_rule module.

Changes For The Developer

We added two tables ir.calendar.month and ir.calendar.day which store the translations of months and week days. This allowed to replace the hard-coded values to format time with locale and re-use the translation infrastructure.
In addition, it provides also a common way for modules to store month or day like in the payment term, instead of duplicate many times the same selections. All standard modules have been migrated.

An old constraint inherited from TinyERP was removed from analytic account. It checked that debit and credit were always positive. We finally remove it to follow the same design as the general accounting.

We use by default soffice to convert report into different formats. But sometime (rarely), soffice command does not stop and so it blocks the request for ever. In order to release the locks of the request transaction, we added a default timeout of 5 minutes to execute the conversion.

We added the option to have ModuleTestCase, the generic test case for a module, to run with extra modules installed. This is useful for module that have extra_depends so the depending code is also tested.

We have speed the startup time of trytond for about 10% by improving the depends computation of the fields.

The plugins for clients are small piece of code that are added to the client in order to preform some specific actions (usually to interact locally with the OS or to define a new widget). We can now define such plugins on the web client too.

Tryton supports a minimal cross-origin resource sharing mechanism. You just have to list the authorized origin in the configuration. For more complex rules, we advise to use a front-end proxy like nginx.

Thanks to the CORS support, we can now redirect the request for the bus to a different host or service. This allows to reduce the load on the main server.

We can now search on keys of Dict of fields using the Tryton’s ORM. On PostgreSQL back-end, Dict fields can be stored as a JSON. In this case, the database can use indexes to speed-up the query.
It is also possible to order the search result based on the keys of Dict fields.

The cache management has been improved to be more transactional. It has now a more transactional-like API by using sync, commit and rollback. Only committed data can be stored in it.

Some times it may be needed to lock a record or a list of records for the transaction. To simplify this task, we added a dualmethod ModelSQL.lock which takes care of the different ways to lock depending of the back-end.

2 Likes