Skip to content

Commit

Permalink
[FIX] website_sale_sepa_dd_payment: validate iban
Browse files Browse the repository at this point in the history
  • Loading branch information
remytms committed Nov 27, 2024
1 parent e2f23c3 commit 6d6f199
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion website_sale_sepa_dd_payment/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions website_sale_sepa_dd_payment/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6d6f199

Please sign in to comment.