From 6d6f19936455e9b08050cee5414fa40fc29b8454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Taymans?= Date: Wed, 27 Nov 2024 10:47:15 +0100 Subject: [PATCH] [FIX] website_sale_sepa_dd_payment: validate iban --- website_sale_sepa_dd_payment/controllers/main.py | 2 +- website_sale_sepa_dd_payment/models/sale_order.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/website_sale_sepa_dd_payment/controllers/main.py b/website_sale_sepa_dd_payment/controllers/main.py index 8caebd2a..ce731864 100644 --- a/website_sale_sepa_dd_payment/controllers/main.py +++ b/website_sale_sepa_dd_payment/controllers/main.py @@ -18,7 +18,7 @@ def shop_payment(self, **post): sepa_dd_iban = "" # Set default values if request.env.user.partner_id.bank_ids: - sepa_dd_iban = request.env.user.partner_id.bank_ids[0].acc_numbre + sepa_dd_iban = request.env.user.partner_id.bank_ids[0].acc_number # Process form if request.httprequest.method == "POST": order = request.website.sale_get_order() diff --git a/website_sale_sepa_dd_payment/models/sale_order.py b/website_sale_sepa_dd_payment/models/sale_order.py index f41f246d..bf6b76e1 100644 --- a/website_sale_sepa_dd_payment/models/sale_order.py +++ b/website_sale_sepa_dd_payment/models/sale_order.py @@ -41,8 +41,8 @@ def action_confirm(self): def validate_sepa_dd_iban(self): """Raise ValidationError if sepa_dd_iban is not correct""" self.ensure_one() - validated_iban = validate_iban(self.sepa_dd_iban) - sanitized_sepa_dd_iban = sanitize_account_number(validated_iban) + validate_iban(self.sepa_dd_iban) + sanitized_sepa_dd_iban = sanitize_account_number(self.sepa_dd_iban) res_partner_bank = self.env["res.partner.bank"].search( [("sanitized_acc_number", "=", sanitized_sepa_dd_iban)], limit=1,