Skip to content
Snippets Groups Projects
Commit b53614fc authored by Martin Trigaux's avatar Martin Trigaux
Browse files

[FIX] base_vat: apply child changes before propagation


The synchronisation of commercial_partner_id was introduced at
0d68acff as a way to ensure the value is always correct.
The order or the operation was not important though.

This synchronisation has a side effect in the following scenario:

0. install base_vat
1. disable vat_check_vies in the settings
2. set an invalid VAT number on a company with at least one contact
3. enable vat_check_vies in the settings
4. correct the VAT number on the company with a valid one
--> an error was raised for an invalid VAT number on the contact

This is because the commercial_partner_id synchronisation is done
before the update of the VAT number. Even if the value has not
changed, this triggers the check_vat method.

Invert both instructions

Courtesy of Wolfgang Taferner

Closes odoo/odoo#43065
Closes odoo/odoo#42973

closes odoo/odoo#47543

X-original-commit: d9b2605e
Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
parent 23e7d0f4
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment