-
-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright 2024 KMEE | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openupgradelib import openupgrade | ||
|
||
|
||
def delete_model(cr, model_name): | ||
openupgrade.logged_query( | ||
cr, | ||
""" | ||
DELETE FROM ir_model_access | ||
WHERE model_id = (SELECT id FROM ir_model where model = '%s') | ||
""" | ||
% model_name, | ||
) | ||
openupgrade.logged_query( | ||
cr, "DELETE FROM ir_model_fields WHERE model = '%s'" % model_name | ||
) | ||
openupgrade.logged_query(cr, "DELETE FROM ir_model WHERE model = '%s'" % model_name) | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
delete_model(env.cr, "l10n_br_nfe.import_xml") |