Tryton News: Newsletter February 2019

@ced wrote:

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.

Posts: 1

Participants: 1

Read full topic

Planet Python

Tryton News: Newsletter January 2019

@ced wrote:

The last month saw a lot of improvements for the developers. Those improvements follow the same trend of consolidating and unifying the Tryton design.

Contents:

Changes For The User

Since the addition of phone number validation, it requires to put the international prefix. But it is usual that users forget it. So now we try to validate the number using the prefix of the address country of the party or the companies party. Then the first valid prefix is stored with the number.

We have removed country code from all default languages. This eases to reuse them as base language for country specific, thanks to the translation cascading mechanism of Tryton.
– Remember, you can help :heart: translate Tryton on https://pootle.tryton.org/

Changes For The Developer

As search and sort on ModelView-only is not supported, the methods are automatically deactivated to avoid the client to emit calls that would fail and raise an error message to the user.

In account module the tax update from template was improved. When updating the chart from template on replacing taxes, former taxes are now de-activated instead of decoupled from the template.

The shipment reports (e.g. delivery note) now uses the correct moves for shipments.
When the inventory moves are empty, – which happen when the shipment locations are the same, – the other moves field will be used.
When a transit location is used for the internal shipment, the used moves field depends on the state. If it is already shipped, then the incoming moves are used to know where to store products. If it is not yet shipped, then the outgoing moves are used to pick the products.

Normally a party should have only one SEPA identifier but in order to ease extension we removed the unique constraint.

Until now the ModelStorage.read-API allows to read the field of the model but also the fields of Many2One and Reference targets. The API has been extended to read related xxx2Many fields. Reading a xxx2Many field results in a list of dictionaries with the requested values and always the id. The name of the key is suffixed by a dot, to avoid name space collisions. :warning: The former API for Many2One has been changed to stay consistent.

We always try to reduce the gap between web and desktop client. So we have implemented the widget attributes: expand, height and width into Sao.

By convention negative ids are reserved for non stored records. The client uses this convention when calling methods on unsaved records. We have decided to enforce this convention with a SQL constraint on every table which checks that the ID column contains a positive integer.

We changed the fallback unit of measure when calling get_sale_price. Before the default unit of the product was used but now it is the sale unit. This is performance improvement because we can now make a single call and retrieve the prices in the right unit for all the products. Before it would require to make a call per unit of measure. This new behavior is not adapted to the purchase module, because when purchasing it is the supplier which defines the unit of measure and not the buyer.

We finally solved a long standing issue with the error messages. The error messages on Model are replaced by records of the new model ir.message. A message can be retrieved translated and formatted by calling gettext method with the XML-ID.
User errors and warnings are now just exceptions raised with messages as arguments. This allows to create custom exceptions by inheriting the base ones for better control and testing.

We implemented the filtering of available models for the model selection of the Reference field, to fix a bug in domain inversion, when the client validates and forces a value depending on the domain.

Posts: 1

Participants: 1

Read full topic

Planet Python

Tryton News: Newsletter December 2018

@udono wrote:

This month was mainly focused on fixing bugs.
But also it is the month where we finally closed the Google Groups in favor of this forum (users can post in there language thanks to translator plugin). We still manage two mailing lists for announces and commits. The former ones are archived.

Contents:

Changes For The User

Some bugs related to the update of chart of account have been fixed. You may need to re-run the wizard to ensure your chart is in sync with the template.

The form view for the invoices and shipments on the sale and purchase form has been removed. Often the user tried to validate or post them from this view which is not always working due to some constraints from the clients design. Indeed the proper way is to open them using the relate feature which provide access to the complete workflow. The list views on the sale and purchase are just there to provide a quick summary.

After 2,5 years, the support for the series 4.0 ended as planned. If you are still using this series or any older, it is highly advise to upgrade to a supported series (the best choice to day is the LTS 5.0).

The “PieceDate” column of the FEC export has been changed for the move date. Before we used the post date but indeed the move date is closer to the definition.

With the removal in series 5.0 of the default accounts on journal, the journal cash report was broken. It was fixed by basing it on the moves of cash journal between receivable/payable and others accounts.

Now, all the tables are correctly responsive in the web client even when they are hidden behind a tab.

Changes For The Developer

An important security issue has been fixed on all supported versions. It allowed an authenticated user to guess value of fields for which he does not have read access.

In order to simplify and to enforce good practice, ModelStorage.read requires to always list the requested fields. Before if no list was provided, it returned the values of all the readable fields.

The documentation on proteus, the scripting library, is now available on proteus — tryton-proteus latest documentation

The cache is now correctly cleaned even when an exception occurs during a test case.

Posts: 1

Participants: 1

Read full topic

Planet Python