Skip to content

Commit 9e617e3

Browse files
committed
[FIX] util/domains.py: fix adapt_domains for OpenERP <= 9.0
The `arch_db` field only appears in version `9.0`. Before that, it was named `arch`. OPW-3508290 UPG-1145148 Part of odoo/upgrade#5154 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent 7e33240 commit 9e617e3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/util/domains.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,11 @@ def adapt_domains(cr, model, old, new, adapter=None, skip_inherit=(), force_adap
292292
)
293293

294294
# adapt search views
295-
arch_db = get_value_or_en_translation(cr, "ir_ui_view", "arch_db")
295+
arch_db = (
296+
get_value_or_en_translation(cr, "ir_ui_view", "arch_db")
297+
if column_exists(cr, "ir_ui_view", "arch_db")
298+
else "arch"
299+
)
296300
cr.execute("SELECT id, model FROM ir_ui_view WHERE {} ~ %s".format(arch_db), [match_old])
297301
for view_id, view_model in cr.fetchall():
298302
# Note: active=None is important to not reactivate views!

0 commit comments

Comments
 (0)