diff --git a/wizard/acc_repartition_keys_wizard.py b/wizard/acc_repartition_keys_wizard.py index a889ece097376b75b36ca01f9742b50b0856aee3..1eaf722b1736324a4f73ccde921d8cb6f0df72b8 100644 --- a/wizard/acc_repartition_keys_wizard.py +++ b/wizard/acc_repartition_keys_wizard.py @@ -72,23 +72,18 @@ class AccRepartitionKeysWizard(models.TransientModel): except (ValueError, IndexError) as exc: raise UserError(_("Fichier de répartitions au mauvais format")) from exc - counter_list_from_operation = self.env[ + entry_file_handler.operation_counter_list = self.env[ "acc.counter.period" ]._get_periods_from_interval( - [("acc_operation_id", "=", self.operation_id.id)], + [("acc_operation_id", "=", self.operation_id.id), ("prm_type", "=", "delivery")], datetime.strptime( entry_file_handler.get_min_date(), "%d-%m-%Y %H:%M" ).date(), datetime.strptime( entry_file_handler.get_max_date(), "%d-%m-%Y %H:%M" ).date(), - ) + ).mapped("acc_counter_id.name") - entry_file_handler.operation_counter_list = [ - period.acc_counter_id.name - for period in counter_list_from_operation - if period.prm_type == "delivery" - ] try: file_check_result = entry_file_handler.check() except (ValueError, IndexError) as exc: