Skip to content

Commit 5581c9f

Browse files
committed
[FIX] adapt_domains: compatibility with old versions
The `active` column on `ir_ui_view` doesn't exists before Odoo 9.0 closes #24 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent ec96b48 commit 5581c9f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/util/domains.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ def adapt_domains(cr, model, old, new, adapter=None, skip_inherit=(), force_adap
314314
if column_exists(cr, "ir_ui_view", "arch_db")
315315
else "arch"
316316
)
317-
cr.execute("SELECT id, model, active FROM ir_ui_view WHERE {} ~ %s".format(arch_db), [match_old])
317+
active_col = "active" if column_exists(cr, "ir_ui_view", "active") else "true"
318+
cr.execute("SELECT id, model, {} FROM ir_ui_view WHERE {} ~ %s".format(active_col, arch_db), [match_old])
318319
for view_id, view_model, view_active in cr.fetchall():
319320
# Note: active=None is important to not reactivate views!
320321
try:

0 commit comments

Comments
 (0)