summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml/base.xml
diff options
context:
space:
mode:
authorNans Lefebvre <len@odoo.com>2019-03-05 12:57:51 +0000
committerNans Lefebvre <len@odoo.com>2019-03-13 14:27:56 +0000
commit215c4a6b5d71c56315f09ce388a8316b76a3a23e (patch)
tree280fa339cc882e9dd39918e12df1bb76a71bef84 /addons/web/static/src/xml/base.xml
parent4b8e0d82bb2463e9d5e3492f7014c89cdc41b5e7 (diff)
[FIX] base: check that the state matches the country at partner create
Import a list of partners with their addresses. The state_id field is usually filled with the state codes. E.g. 'CA' is used for California, but also for Cádiz (Spain), etc. The import function (db_id_for) uses a name_search on the res.country.state, and takes the first matching result. It follows that the state does not necessarily match the country. Therefore we add a _check_import_consistency in the create. Here we check that the country matches the state's country, try to find a correct match, and if we can't we put the state to False. Note that if the country is not set both fields will end up set to False: this is because only a state would mean using a code could give an abitrary country. opw 1943904 closes odoo/odoo#31599 Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
0 files changed, 0 insertions, 0 deletions