Newsletter July 2018


(Cédric Krier) #1

This month, the biggest task was to migrate the full code base of Tryton to Python 3. So the next release 5.0 will be only supported by Python 3.4 or later.

The nap by Vincent Van Gogh

Changes for the user

Don’t show search window for single result in Many2Many

When the user fill the search entry of a Many2Many for which the search result is a single record, we do not show any more the search window but add it directly. This is the same behavior as for the Many2One.

Add some margin on modal in the web client

In previous change, we made modal taking 100% of the width. But it may be confusing for the user to understand that it is a modal, so we have restored a small margin.

Shortcut reworked

Some shortcuts were in conflict with existing one from the OS or the browser. So we reworked them to minimize the overlap but keep them efficient.

Product description on subscription

Like the other documents, the subscription line does not copy the product description anymore and so reduce the duplication of data.

Removal of accounting on product

In order to have a better privilege separation between the accounting and the product manager, we removed all accounting configuration from the product and used only the accounting category to define them. So only a member of the accounting group can edit them.
This requires that prior to the migration to 5.0, all products must be setup to use an accounting category.

Prevent to modify lot

If the lot has been already used for a stock move, we forbid to change the product attribute of the lot in order to keep the integrity of the data.

Allow to configure the date of depreciation move

We added two new configurations for depreciation of assets:

  • The day of the month: First or Last
  • The month (when depreciation is yearly)

Import the statement format AEB43

The AEB43 is a format from the Spanish Association of Banks. The new module account_statement_aeb43 allow to use the standard wizard to import AEB43 files as statements.

Changes for the developer

Calendar view trigger on_change

When a new record is created from a calendar view, the start date is automatically set. Now this assignation trigger a on_change call.

Use context for windows suffix

When a tab is open from selected records, the client append automatically the name of those records to the title of the tab. The RPC call to get the record names uses now the context of the tab opened.

Better cleaning of ir.model and ir.model.field

The cleaning was run after the registration of each model but per module. So if a model was registered multiple times in the same module, the late fields were deleted before being re-create. This was an issue if they were referenced as foreign key in another table. We clean now only once after the initialization of all the modules.

Graph dependency resolution

We simplified the algorithm that resolve the graph dependency from being exponential to linear. We registered an improvement of 80% on the time for the 122 standard modules.

Compute production cost at the end

Instead of setting the theoretical cost on the produced product at the beginning, we set it at the end using the final cost which will include the cost of the actual work etc.

The domain is no more validated for Function field

We consider that it is the responsibility of the underlying storage to ensure the validity of the data. So we do not validate the domain on Function field. This reduces the time of record validation. Another side effect is to allow to set a domain on Function field without the need to have a searcher method.

Sao supports the width attribute on tree view

The support of width attribute was missing in sao, the web client. This is no more the case. Developers can now rely on it to design better views.

Support view_id in switch client action

The client action switch, which had only a view_type argument, accepts now also a view_id. When it is set the client will switch to this exact view and it will fetch it from the server if needed.

Improve client loading strategy

The strategy has been improved to take into account to eagerly load only the fields that are on the same view. This new strategy is mainly useful when multiple form views are defined.

Simplify start/end date on subscription line

We made the start date required on the line and fill it by default with the start date of the subscription.

Copy return new records in the same order

This assumption is used many times in the modules but it was not guarantee by the code nor the documentation. Now we ensure thanks to a unit test that the order of returned records follows the order of the input records. This change will be back-ported to all supported branches even if it changes the API because it fixes bugs in some modules.

Improve record rules validation

As the rules may depend on relational fields, we validate them after having written those fields. Also on write, we checked the rule before the modification but not after. So it was possible for a user to modify a record that he will no more be allowed to modify it back. Now, we check the rules also after the modification.

Add support for (i)like operator for domain validation

The clients pre-validate the records by evaluating the domain. Until now like and ilike operators were always evaluated as valid. But it is no more the case with the implementation of the operators as regular expressions.