File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1919 "depends" : [
2020 "account" ,
2121 "l10n_it_edi" ,
22+ "l10n_it_edi_ndd" ,
2223 "partner_firstname" ,
2324 ],
2425 "data" : [
You can’t perform that action at this time.
0 commit comments