diff --git a/l10n_it_account/migrations/18.0.1.0.0/post-migration.py b/l10n_it_account/migrations/18.0.1.0.0/post-migration.py index 5313dbbc6ce1..f577171a5544 100644 --- a/l10n_it_account/migrations/18.0.1.0.0/post-migration.py +++ b/l10n_it_account/migrations/18.0.1.0.0/post-migration.py @@ -6,6 +6,7 @@ OLD_MODULES = [ "l10n_it_account_tax_kind", "l10n_it_fatturapa", + "l10n_it_withholding_tax", ] @@ -96,6 +97,22 @@ def _l10n_it_account_tax_kind_migration(env): ) +def _l10n_it_withholding_tax_migration(env): + """ + Delete views coming from old module l10n_it_withholding_tax. + """ + query = """ + DELETE FROM ir_ui_view + WHERE id IN ( + SELECT imd.res_id + FROM ir_model_data imd + WHERE imd.module = 'l10n_it_withholding_tax' + AND imd.model = 'ir.ui.view' + ) + """ + openupgrade.logged_query(env.cr, query) + + def _l10n_it_fatturapa_migration(env): """ Remove exclusion for installation of "l10n_it_edi"