diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 0000000000000000000000000000000000000000..5b6d4b361ace92f3877993bf2848fac190d8fab6 --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,8 @@ +# Defaults for all prettier-supported languages. +# Prettier will complete this with settings from .editorconfig file. +bracketSpacing: false +printWidth: 88 +proseWrap: always +semi: true +trailingComma: "es5" +xmlWhitespaceSensitivity: "strict" diff --git a/tools/key_file.py b/tools/key_file.py index 3c70b19a9ac883946eb509336e8e51e9ea99eef8..b7e6a0c6c9a3a382d829f87d46b30a34aee92311 100644 --- a/tools/key_file.py +++ b/tools/key_file.py @@ -3,6 +3,7 @@ Repartion key entry file handler """ import csv from datetime import datetime + from odoo.addons.api_connector.tools.date_utils import local_to_utc @@ -118,7 +119,7 @@ class RepartitionKeyEntryFile: if len(counter_list_from_file) != len(set(counter_list_from_file)): return { "check": False, - f"message": "Des numéros de PRM apparaissent plusieurs fois" + "message": "Des numéros de PRM apparaissent plusieurs fois", } if sorted(self.operation_counter_list) == sorted(counter_list_from_file): @@ -137,8 +138,8 @@ class RepartitionKeyEntryFile: if missing_in_file or missing_in_operation: return { "check": False, - f"message": "Les numéros de PRM ne correspondent " - f"pas à ceux de l’opération", + "message": "Les numéros de PRM ne correspondent " + "pas à ceux de l’opération", } return {"check": True, "message": ""} diff --git a/wizard/acc_repartition_keys_wizard.py b/wizard/acc_repartition_keys_wizard.py index e5a97bb9ed6ad06bd372e120f08bba76d76d1ba7..2f4fa917668408399ace667eeb5e62b1d7cbefc9 100644 --- a/wizard/acc_repartition_keys_wizard.py +++ b/wizard/acc_repartition_keys_wizard.py @@ -72,17 +72,22 @@ class AccRepartitionKeysWizard(models.TransientModel): except (ValueError, IndexError) as exc: raise UserError(_("Fichier de répartitions au mauvais format")) from exc - entry_file_handler.operation_counter_list = self.env[ - "acc.counter.period" - ]._get_periods_from_interval( - [("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 = ( + self.env["acc.counter.period"] + ._get_periods_from_interval( + [ + ("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") + ) try: file_check_result = entry_file_handler.check() diff --git a/wizard/acc_repartition_keys_wizard_views.xml b/wizard/acc_repartition_keys_wizard_views.xml index e7e154fedca01985726fc79ec30617b910f517db..81b5da0a99e588979e36e1c7216f77cd3ce5a2d0 100644 --- a/wizard/acc_repartition_keys_wizard_views.xml +++ b/wizard/acc_repartition_keys_wizard_views.xml @@ -9,26 +9,23 @@ <field widget="binary" name="csv_file" filename="filename" /> <footer> <button - class="btn btn-primary" - name="send_imported_file" - type="object" - string="Envoyer a enedis" - /> + class="btn btn-primary" + name="send_imported_file" + type="object" + string="Envoyer a Enedis" + /> <button - class="btn btn-primary" - name="ignore" - type="object" - string="Ignorer" - /> + class="btn btn-primary" + name="ignore" + type="object" + string="Ignorer" + /> </footer> </form> </field> </record> - <record - id="acc_repartition_keys_wizard_action" - model="ir.actions.act_window" - > + <record id="acc_repartition_keys_wizard_action" model="ir.actions.act_window"> <field name="name">Création clés de repartition</field> <field name="type">ir.actions.act_window</field> <field name="res_model">acc.repartition.keys.wizard</field>