From 09912a73a2ece6e5e12bb6db65c28687143bd79c Mon Sep 17 00:00:00 2001 From: ypapouin Date: Sun, 1 Mar 2020 22:40:06 +0100 Subject: [PATCH] Fix migration when state_id is NULL --- base_location/migrations/12.0.1.0.0/post-migration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_location/migrations/12.0.1.0.0/post-migration.py b/base_location/migrations/12.0.1.0.0/post-migration.py index db2a67baa..1f9041b56 100644 --- a/base_location/migrations/12.0.1.0.0/post-migration.py +++ b/base_location/migrations/12.0.1.0.0/post-migration.py @@ -36,7 +36,7 @@ def migrate(env, version): SET city_id = rc.id FROM res_city rc WHERE rc.name = rbz.city - AND rc.state_id = rbz.state_id + AND rc.state_id IS NOT DISTINCT FROM rbz.state_id AND rc.country_id = rbz.country_id AND rbz.city_id IS NULL""", )