-
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by rvalyi
- Loading branch information
Showing
18 changed files
with
109 additions
and
675 deletions.
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
22 changes: 0 additions & 22 deletions
22
l10n_br_account_payment_brcobranca/models/account_payment_mode.py
This file was deleted.
Oops, something went wrong.
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
105 changes: 105 additions & 0 deletions
105
l10n_br_account_payment_order/migrations/14.0.9.0.0/pre-migration.py
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,105 @@ | ||
# Copyright (C) 2024-Today - Akretion (<http://www.akretion.com>). | ||
# @author Magno Costa <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openupgradelib import openupgrade | ||
|
||
|
||
def update_model_data(env): | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
UPDATE ir_model_data SET model = 'l10n_br_cnab.code' | ||
WHERE model = 'l10n_br_cnab.mov.instruction.code' | ||
""", | ||
) | ||
# Codigo de Retorno | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
UPDATE ir_model_data SET model = 'l10n_br_cnab.code' | ||
WHERE model = 'l10n_br_cnab.return.move.code' | ||
""", | ||
) | ||
# Codigo Carteira | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
UPDATE ir_model_data SET model = 'l10n_br_cnab.code' | ||
WHERE model = 'l10n_br_cnab.boleto.wallet.code' | ||
""", | ||
) | ||
|
||
|
||
def delete_obsolete_models(env): | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
DELETE FROM ir_model_fields WHERE model = 'l10n_br_cnab.mov.instruction.code' | ||
""", | ||
) | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
DELETE FROM ir_model WHERE model = 'l10n_br_cnab.mov.instruction.code' | ||
""", | ||
) | ||
# Codigo de Retorno | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
DELETE FROM ir_model_fields WHERE model = 'l10n_br_cnab.return.move.code' | ||
""", | ||
) | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
DELETE FROM ir_model WHERE model = 'l10n_br_cnab.return.move.code' | ||
""", | ||
) | ||
# Codigo Carteira | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
DELETE FROM ir_model_fields WHERE model = 'l10n_br_cnab.boleto.wallet.code' | ||
""", | ||
) | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
DELETE FROM ir_model WHERE model = 'l10n_br_cnab.boleto.wallet.code' | ||
""", | ||
) | ||
|
||
|
||
def delete_obsolete_data(env): | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
DELETE FROM l10n_br_cnab_mov_instruction_code | ||
""", | ||
) | ||
|
||
# Codigo de Retorno | ||
# Data | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
DELETE FROM l10n_br_cnab_return_move_code | ||
""", | ||
) | ||
# Codigo Carteira | ||
# Data | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
DELETE FROM l10n_br_cnab_boleto_wallet_code | ||
""", | ||
) | ||
|
||
|
||
@openupgrade.migrate(use_env=True) | ||
def migrate(env, version): | ||
update_model_data(env) | ||
delete_obsolete_models(env) | ||
delete_obsolete_data(env) |
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
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
Oops, something went wrong.