From c17a9203dd4d607c23896f5a28edf06a9660a9ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0=C3=ADrek?= Date: Wed, 26 Aug 2026 23:40:23 +0200 Subject: [PATCH 1/3] fix: disable auto_install on base_import_ux The module changes the import UI globally for all companies and was not deployed on 18.0. Installing it must be a deliberate decision, not a side effect of base_import + base_setup being present. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01VLNMeXEWNPb2xPfPDnVeA1 --- base_import_ux/__manifest__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base_import_ux/__manifest__.py b/base_import_ux/__manifest__.py index 2bd795af..e1ef5a1b 100644 --- a/base_import_ux/__manifest__.py +++ b/base_import_ux/__manifest__.py @@ -43,6 +43,8 @@ ], }, "installable": True, - "auto_install": True, + # BTL: auto_install vypnut -- modul meni importni UI globalne pro vsechny firmy + # a v 18.0 nasazeny nebyl; instalovat jen vedome. R-17663 + "auto_install": False, "application": False, } From 2271919031aaea8c907bd20187c1927e2377327a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0=C3=ADrek?= Date: Wed, 26 Aug 2026 23:40:38 +0200 Subject: [PATCH 2/3] fix: auto_install --- base_import_ux/__manifest__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/base_import_ux/__manifest__.py b/base_import_ux/__manifest__.py index e1ef5a1b..9ffb5cd4 100644 --- a/base_import_ux/__manifest__.py +++ b/base_import_ux/__manifest__.py @@ -43,8 +43,6 @@ ], }, "installable": True, - # BTL: auto_install vypnut -- modul meni importni UI globalne pro vsechny firmy - # a v 18.0 nasazeny nebyl; instalovat jen vedome. R-17663 "auto_install": False, "application": False, } From 422c799b9ddf4bc627253ba0ff148ccf70ef281b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0=C3=ADrek?= Date: Thu, 27 Aug 2026 06:43:46 +0200 Subject: [PATCH 3/3] fix: drop odoo.upgrade.util import from base_ux migration odoo.upgrade.util ships in the separate odoo/upgrade-util repo and is only importable when Odoo runs with --upgrade-path. A plain 'odoo-bin -u' branch build has no such path, so the import raised ImportError and aborted the registry load. util.remove_view is reimplemented in raw SQL; ir_ui_view. inherit_id is ondelete='restrict', so the inheritance tree is deleted bottom-up, deepest level first. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01VLNMeXEWNPb2xPfPDnVeA1 --- base_ux/migrations/19.0.1.4.0/pre-migrate.py | 53 ++++++++++++++++++-- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/base_ux/migrations/19.0.1.4.0/pre-migrate.py b/base_ux/migrations/19.0.1.4.0/pre-migrate.py index 6272dc54..c22d65c1 100644 --- a/base_ux/migrations/19.0.1.4.0/pre-migrate.py +++ b/base_ux/migrations/19.0.1.4.0/pre-migrate.py @@ -1,6 +1,53 @@ -from odoo.upgrade import util +import logging + +from openupgradelib import openupgrade + +_logger = logging.getLogger(__name__) + +# BTL: ``odoo.upgrade`` exposes ``util`` only when Odoo runs with ``--upgrade-path`` +# (it lives in the separate odoo/upgrade-util repo, not in odoo core). A plain +# ``odoo-bin -u`` branch build has no such path, so the import raises ImportError and +# aborts the whole registry load. Reimplemented in raw SQL, which is what a pre-migrate +# stage allows anyway. ``ir_ui_view.inherit_id`` is ``ondelete='restrict'``, so the +# inheritance tree has to be deleted bottom-up, deepest level first. +# TODO: Upgrade 19.0 - revert if upgrade-util is ever vendored. + +OBSOLETE_VIEWS = [ + ("base_ux", "view_partner_form_mobile"), + ("base_ux", "view_partner_tree_mobile"), +] def migrate(cr, version): - util.remove_view(cr, "base_ux.view_partner_form_mobile") - util.remove_view(cr, "base_ux.view_partner_tree_mobile") + for module, name in OBSOLETE_VIEWS: + cr.execute( + "SELECT res_id FROM ir_model_data WHERE module = %s AND name = %s AND model = 'ir.ui.view'", + (module, name), + ) + row = cr.fetchone() + if not row: + _logger.info("View %s.%s not present, nothing to remove", module, name) + continue + + cr.execute( + """ + WITH RECURSIVE tree AS ( + SELECT id, 0 AS depth FROM ir_ui_view WHERE id = %s + UNION ALL + SELECT child.id, tree.depth + 1 + FROM ir_ui_view child + JOIN tree ON child.inherit_id = tree.id + ) + SELECT depth, array_agg(id) FROM tree GROUP BY depth ORDER BY depth DESC + """, + (row[0],), + ) + for depth, view_ids in cr.fetchall(): + view_ids = tuple(view_ids) + openupgrade.logged_query( + cr, + "DELETE FROM ir_model_data WHERE model = 'ir.ui.view' AND res_id IN %s", + (view_ids,), + ) + openupgrade.logged_query(cr, "DELETE FROM ir_ui_view WHERE id IN %s", (view_ids,)) + _logger.info("Removed %s inherited view(s) at depth %s of %s.%s", len(view_ids), depth, module, name)