-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REF] eng_cnab_filename: adapt new cnab config
- Loading branch information
1 parent
b7b3d5b
commit 3c14d20
Showing
6 changed files
with
38 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2024 - Engenere (<https://engenere.one>). | ||
# @author Antônio S. Pereira Neto <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openupgradelib import openupgrade | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
# Verifique se o campo antigo existe no banco de dados | ||
if openupgrade.column_exists( | ||
env.cr, "account_payment_mode", "filename_sequence_id" | ||
): | ||
# Atualizar o arquivo cnab_config_id com filename_sequence_id | ||
env.cr.execute( | ||
""" | ||
UPDATE l10n_br_cnab_config cc | ||
SET filename_sequence_id = ( | ||
SELECT filename_sequence_id | ||
FROM account_payment_mode apm | ||
WHERE apm.cnab_config_id = cc.id | ||
) | ||
WHERE EXISTS ( | ||
SELECT 1 | ||
FROM account_payment_mode apm | ||
WHERE apm.cnab_config_id = cc.id | ||
AND apm.filename_sequence_id IS NOT NULL | ||
) | ||
""" | ||
) |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from . import account_payment_order | ||
from . import account_payment_mode | ||
from . import cnab_config |
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