The last month saw a lot of improvements for the developers. Those improvements follow the same trend of consolidating and unifying the Tryton design.
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 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-APIallows to read the field of the model but also the fields of
Referencetargets. The API has been extended to read related
xxx2Manyfields. Reading a
xxx2Manyfield 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. The former API for
Many2Onehas been changed to stay consistent.
We always try to reduce the gap between web and desktop client. So we have implemented the widget attributes:
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
Referencefield, to fix a bug in domain inversion, when the client validates and forces a value depending on the domain.