forked from OCA/l10n-brazil
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Data of rename objects need migrations scripts to avoid error.
- Loading branch information
Showing
3 changed files
with
34 additions
and
5 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
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: 22 additions & 0 deletions
22
l10n_br_account_payment_order/migrations/12.0.3.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,22 @@ | ||
# @ 2020 Akretion - www.akretion.com.br - | ||
# Magno Costa <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) | ||
|
||
from openupgradelib import openupgrade | ||
|
||
_table_renames = [ | ||
('cnab_return_move_code', 'l10n_br_cnab_return_move_code'), | ||
] | ||
|
||
_model_renames = [ | ||
('cnab.return.move.code', 'l10n_br_cnab.return.move.code'), | ||
('cnab.return.log', 'l10n_br_cnab.return.log'), | ||
('cnab.return.event', 'l10n_br_cnab.return.event'), | ||
('cnab.return.lot', 'l10n_br_cnab.return.lot'), | ||
] | ||
|
||
|
||
@openupgrade.migrate(use_env=True) | ||
def migrate(env, version): | ||
openupgrade.rename_tables(env.cr, _table_renames) | ||
openupgrade.rename_models(env.cr, _model_renames) |