From 7558aac896f9cd46a2cf4ac39caebb49bf3902e0 Mon Sep 17 00:00:00 2001 From: SimoRubi Date: Tue, 7 Dec 2021 12:43:32 +0100 Subject: [PATCH] [COV] l10n_it_fatturapa_out: Run export wizard on more invoices Co-authored-by: Simone Rubino --- l10n_it_fatturapa_out/tests/fatturapa_common.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/l10n_it_fatturapa_out/tests/fatturapa_common.py b/l10n_it_fatturapa_out/tests/fatturapa_common.py index 7bd084cabb72..d547713a79e1 100644 --- a/l10n_it_fatturapa_out/tests/fatturapa_common.py +++ b/l10n_it_fatturapa_out/tests/fatturapa_common.py @@ -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 @@ -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