-
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix]l10n_it_vat_statement_communication fix conflict
[FIX]l10n_it_vat_statement_communication fix typo
- Loading branch information
1 parent
fb77e79
commit 0d43222
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
l10n_it_vat_statement_communication/migrations/16.0.1.1.0/pre-migrate.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,40 @@ | ||
import logging | ||
|
||
from openupgradelib import openupgrade | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
if not version: | ||
return | ||
|
||
rm_old_vat_communication_multi_company_rule(env) | ||
|
||
|
||
def rm_old_vat_communication_multi_company_rule(env): | ||
_logger.info( | ||
"Migration of l10n_it_vat_statement_communication - search for" | ||
" previous multi company rule for 'comunicazione.liquidazione' model" | ||
) | ||
module = "l10n_it_vat_statement_communication" | ||
rule_xml_id = "comunucazione_liquidazione_iva_multi_company" | ||
old_vat_comm_multi_company_rule_ref = env.ref( | ||
f"{module}.{rule_xml_id}", raise_if_not_found=False | ||
) | ||
|
||
if not old_vat_comm_multi_company_rule_ref: | ||
# avoid unlink not existent record | ||
_logger.warning( | ||
"Migration of l10n_it_vat_statement_communication - previous" | ||
" multi company rule for 'comunicazione.liquidazione' model not" | ||
" found" | ||
) | ||
return | ||
|
||
_logger.info( | ||
"Migration of l10n_it_vat_statement_communication - unlink" | ||
" previous multi company rule for 'comunicazione.liquidazione' model" | ||
) | ||
old_vat_comm_multi_company_rule_ref.unlink() |
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