Skip to content

Commit 2df4ee8

Browse files
committed
Merge PR #4978 into 18.0
Signed-off-by eLBati
2 parents bce4773 + 0524130 commit 2df4ee8

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

l10n_it_edi_extension/__init__.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"l10n_it_fatturapa",
1616
"l10n_it_fatturapa_in",
1717
"l10n_it_fatturapa_out",
18+
"l10n_it_fiscal_document_type",
1819
"l10n_it_fiscal_payment_term",
1920
"l10n_it_fiscalcode",
2021
"l10n_it_ipa",
@@ -830,21 +831,18 @@ def _l10n_it_fatturapa_out_post_migration(env):
830831
attachment.res_field = "l10n_it_edi_attachment_file"
831832

832833

833-
def _l10n_it_fiscal_payment_term_post_migration(env):
834-
if not openupgrade.column_exists(env.cr, "account_move", "l10n_it_payment_method"):
835-
field_spec = [
836-
(
837-
"l10n_it_payment_method",
838-
"account.move",
839-
"account_move",
840-
"selection",
841-
"varchar",
842-
"l10n_it_edi_ndd",
843-
False,
844-
)
845-
]
846-
openupgrade.add_fields(env, field_spec)
834+
def _l10n_it_fiscal_document_type_post_migration(env):
835+
query = """
836+
UPDATE account_move
837+
SET l10n_it_document_type = lidt.id
838+
FROM fiscal_document_type fdt
839+
LEFT JOIN l10n_it_document_type lidt ON lidt.code = fdt.code
840+
WHERE account_move.fiscal_document_type_id = fdt.id
841+
"""
842+
openupgrade.logged_query(env.cr, query)
847843

844+
845+
def _l10n_it_fiscal_payment_term_post_migration(env):
848846
query = """
849847
UPDATE account_move
850848
SET l10n_it_payment_method = fpm.code

l10n_it_edi_extension/__manifest__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"depends": [
2020
"account",
2121
"l10n_it_edi",
22+
"l10n_it_edi_ndd",
2223
"partner_firstname",
2324
],
2425
"data": [

0 commit comments

Comments
 (0)