Please sign in to comment.
[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 #31599 Signed-off-by: Nans Lefebvre (len) <firstname.lastname@example.org>
- Loading branch information...
Showing with 22 additions and 0 deletions.