# Newsletter January 2019

**URL:** https://discuss.tryton.org/t/newsletter-january-2019/957
**Category:** News
**Created:** [January 1, 2019, 6:59am UTC](https://discuss.tryton.org/t/newsletter-january-2019/957 "2019-01-01T06:59:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [January 1, 2019, 6:59am UTC](https://discuss.tryton.org/t/newsletter-january-2019/957/1 "2019-01-01T06:59:59Z")

</div>

![Happy New Year](https://discuss-cdn.tryton.org/uploads/default/original/1X/666db6cd8972fa13b5191dca21c95a3c961e9b69.jpeg)

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 users](#heading--users)
- [Changes for developers](#heading--developers)

# Changes For The User

Since the [addition of phone number validation](https://bugs.tryton.org/issue4329), 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](https://bugs.tryton.org/issue7831) of the party or the companies party. Then the first valid prefix is stored with the number.

We have [removed country code](https://bugs.tryton.org/issue7863) 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/](https://pootle.tryton.org/) –

# Changes For The Developer

As search and sort on `ModelView`-only is not supported, the [methods are automatically deactivated](https://bugs.tryton.org/issue7878) 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](https://bugs.tryton.org/issue7718). 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](https://bugs.tryton.org/issue7881).  
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](https://bugs.tryton.org/issue7937).

Until now the [`ModelStorage.read-API`](http://docs.tryton.org/projects/server/en/latest/ref/models/models.html#trytond.model.ModelStorage.read) 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](https://discuss.tryton.org/t/allow-to-read-related-xxx2many/905). 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. ⚠ 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`](https://bugs.tryton.org/issue7886) 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](https://bugs.tryton.org/issue7867).

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](https://bugs.tryton.org/issue7855). 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](http://docs.tryton.org/projects/server/en/5.0/ref/models/models.html#trytond.model.Model._error_messages) are replaced by records of the [new model `ir.message`](https://bugs.tryton.org/issue3672). A message can be retrieved translated and formatted by calling [gettext method](http://docs.tryton.org/projects/server/en/latest/ref/i18n.html#trytond.i18n.gettext) with the XML-ID.  
[User errors and warnings](http://docs.tryton.org/projects/server/en/latest/topics/user_errors_warnings.html) 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](https://bugs.tryton.org/issue7869), when the client validates and forces a value depending on the domain.

---

<div class="post-metadata">

### Author: ![parviz](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/parviz/32/1274_2.png) [@parviz](https://discuss.tryton.org/u/parviz)
#### Post date: [January 1, 2019, 2:55pm UTC](https://discuss.tryton.org/t/newsletter-january-2019/957/2 "2019-01-01T14:55:51Z")

</div>

Hi All  
Thanks alot and Great job…  
Happy New year!

---

<div class="post-metadata">

### Author: ![parviz](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/parviz/32/1274_2.png) [@parviz](https://discuss.tryton.org/u/parviz)
#### Post date: [January 2, 2019, 12:42pm UTC](https://discuss.tryton.org/t/newsletter-january-2019/957/3 "2019-01-02T12:42:33Z")

</div>

The translation of the last changes into Persian was done 100%…
