diff options
| author | oco-odoo <oco@odoo.com> | 2021-04-07 12:44:15 +0000 |
|---|---|---|
| committer | oco-odoo <oco@odoo.com> | 2021-04-09 12:08:01 +0000 |
| commit | 7faa11ca87cb5308df1d1921a674e2e2edc3f065 (patch) | |
| tree | ede3bb12227e2aa2d412c3f07a8bb2eb27a8c975 /doc/python3.rst | |
| parent | d5075308131f82020702c6650a1869ffd93fb85e (diff) | |
[FIX] base_vat: patch orm limitation
https://github.com/odoo/odoo/pull/68253 fixed a bug in check_vat that caused it not to run any check when called on a partner with no country.
However, doing this caused another issue because of an ORM limitation: when writing vat and country_id with a single write() on the res.company, two distinct write are triggered on the related res.partner, one for each field. Both those write trigger the check_vat constraint.
Depending on the order in which the keys of the dictionnary passed to res.company's write were ordered, country_id could or could not be written before vat. If vat was written first and did not start with a country code, the write() on res.partner failed the constraint, because country_id wasn't set yet. This was wrong, but used to pass as there was no country_id on the partner, before https://github.com/odoo/odoo/pull/68253 fixed that.
To circumvent the issue, we now allow entering any vat number without performing any check if it does not start with a country code and no country_id is set on the partner.
closes odoo/odoo#69034
X-original-commit: 3b73ea994a0eedc08ee0e7c43610ca5e78984b54
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Diffstat (limited to 'doc/python3.rst')
0 files changed, 0 insertions, 0 deletions
