Skip to content

Commit

Permalink
[COV] l10n_it_fatturapa_out: Run export wizard on more invoices
Browse files Browse the repository at this point in the history
Co-authored-by:  Simone Rubino <[email protected]>
  • Loading branch information
SimoRubi and SirAionTech committed Jun 13, 2024
1 parent 82c0f17 commit cf2fa4c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions l10n_it_fatturapa_out/tests/fatturapa_common.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2023 Simone Rubino - Aion Tech
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

import base64
import tempfile

Expand Down Expand Up @@ -228,9 +231,17 @@ def set_sequences(
seq_date = inv_seq._create_date_range_seq(dt)
seq_date.number_next_actual = invoice_number

def run_wizard(self, invoice_id):
def run_wizard(self, invoice_ids):
"""
Execute the export wizard on the invoices having ID `invoice_ids`.
:param invoice_ids: integer or list of integers
:return: result of export wizard
"""
if not isinstance(invoice_ids, list):
invoice_ids = [invoice_ids]
wizard = self.wizard_model.create({})
return wizard.with_context(active_ids=invoice_id).exportFatturaPA()
return wizard.with_context(active_ids=invoice_ids).exportFatturaPA()

def set_e_invoice_file_id(self, e_invoice, file_name):
# We need this because file name is random and we can't predict it
Expand Down

0 comments on commit cf2fa4c

Please sign in to comment.