Skip to content

Commit

Permalink
[fix]l10n_it_vat_statement_communication fix conflict
Browse files Browse the repository at this point in the history
[FIX]l10n_it_vat_statement_communication fix typo
  • Loading branch information
matteoopenf committed Sep 16, 2024
1 parent fb77e79 commit 0d43222
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
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()
2 changes: 1 addition & 1 deletion l10n_it_vat_statement_communication/security/security.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<data noupdate="1">

<record model="ir.rule" id="comunucazione_liquidazione_iva_multi_company">
<record model="ir.rule" id="comunicazione_liquidazione_iva_multi_company">
<field name="name">VAT statement communication multi-company</field>
<field name="model_id" ref="model_comunicazione_liquidazione" />
<field name="global" eval="True" />
Expand Down

0 comments on commit 0d43222

Please sign in to comment.