diff --git a/views/acc_operation_views.xml b/views/acc_operation_views.xml index ac9c54cd7b7d198f95fc1f46c74827c725a3bcf6..c6837c6ebf192d58fb2a096c5143d03c82a5e3a8 100644 --- a/views/acc_operation_views.xml +++ b/views/acc_operation_views.xml @@ -8,7 +8,7 @@ <field name="inherit_id" ref="oacc.acc_operation_form_view" /> <field name="arch" type="xml"> <xpath expr="//notebook" position="inside"> - <page string="clés de répartition" name="keys"> + <page string="Clés de répartition" name="keys"> <field name="keys_repartition_ids" mode="tree"> <tree create="0"> <field name="date_send" /> diff --git a/wizard/acc_repartition_keys_wizard.py b/wizard/acc_repartition_keys_wizard.py index 1f4de09f2ee7dc7e574695565604ecbbbb21e536..a889ece097376b75b36ca01f9742b50b0856aee3 100644 --- a/wizard/acc_repartition_keys_wizard.py +++ b/wizard/acc_repartition_keys_wizard.py @@ -72,21 +72,23 @@ 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["acc.counter.period"] - ._get_periods_from_interval( - [("acc_operation_id", "=", self.operation_id.id)], - 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") + counter_list_from_operation = self.env[ + "acc.counter.period" + ]._get_periods_from_interval( + [("acc_operation_id", "=", self.operation_id.id)], + 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(), ) - entry_file_handler.operation_counter_list = counter_list_from_operation + 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: