From 901a73ccd0462978fa8d7f0ad01a5fb4a7d65cbb Mon Sep 17 00:00:00 2001
From: luca <luca.delauren@gmail.com>
Date: Fri, 31 May 2024 10:22:26 +0200
Subject: [PATCH] Changes of pre-commit.

---
 .../models/account_payment_order.py               | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/l10n_ch_pain_direct_debit/models/account_payment_order.py b/l10n_ch_pain_direct_debit/models/account_payment_order.py
index 0d0f6de97..79ce07b26 100644
--- a/l10n_ch_pain_direct_debit/models/account_payment_order.py
+++ b/l10n_ch_pain_direct_debit/models/account_payment_order.py
@@ -19,11 +19,13 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 ##############################################################################
-from lxml import etree
 import re
+
+from lxml import etree
+
 from odoo import api, fields, models
 from odoo.exceptions import UserError
-from odoo.tools import float_round,mod10r
+from odoo.tools import float_round, mod10r
 
 ACCEPTED_PAIN_FLAVOURS = ("pain.008.001.02.ch.03",)
 
@@ -421,7 +423,8 @@ def generate_remittance_info_block(self, parent_node, line, gen_args):
             remittance_info_unstructured = etree.SubElement(remittance_info, "Ustrd")
             remittance_info_unstructured.text = self._prepare_field(
                 "Remittance Unstructured Information",
-                "line.payment_line_ids[0].move_line_id.move_id.ref or line.payment_line_ids[0].move_line_id.move_id.name",
+                "line.payment_line_ids[0].move_line_id.move_id.ref or "
+                "line.payment_line_ids[0].move_line_id.move_id.name",
                 {"line": line},
                 140,
                 gen_args=gen_args,
@@ -440,13 +443,13 @@ def generate_remittance_info_block(self, parent_node, line, gen_args):
             creditor_ref_info_type_code.text = "ESR"
             creditor_reference = etree.SubElement(creditor_ref_information, "Ref")
             ref = line.payment_line_ids[0].communication
-            if re.match(r'^(\d{2,27})$', ref):
+            if re.match(r"^(\d{2,27})$", ref):
                 if ref == mod10r(ref[:-1]):
                     creditor_reference.text = ref
                 else:
-                    raise UserError(ref + ': control digit failed (QRR or ESR)')
+                    raise UserError(ref + ": control digit failed (QRR or ESR)")
             else:
-                raise UserError(ref + ' is not QRR or ESR ref')
+                raise UserError(ref + " is not QRR or ESR ref")
         else:
             super().generate_remittance_info_block(parent_node, line, gen_args)