Skip to content
Permalink
Browse files

[FIX] base_iban: fix acc_number processing

  • Loading branch information...
asaunier committed Feb 20, 2019
1 parent 3e5ab60 commit debd59613fe09d0e2c65e5ea90abbb8418cc4249
Showing with 10 additions and 2 deletions.
  1. +10 −2 addons/base_iban/models/res_partner_bank.py
@@ -70,13 +70,21 @@ def get_bban(self):
@api.model
def create(self, vals):
if vals.get('acc_number'):
vals['acc_number'] = pretty_iban(normalize_iban(vals['acc_number']))
try:
validate_iban(vals['acc_number'])
vals['acc_number'] = pretty_iban(normalize_iban(vals['acc_number']))
except ValidationError:
pass
return super(ResPartnerBank, self).create(vals)

@api.multi
def write(self, vals):
if vals.get('acc_number'):
vals['acc_number'] = pretty_iban(normalize_iban(vals['acc_number']))
try:
validate_iban(vals['acc_number'])
vals['acc_number'] = pretty_iban(normalize_iban(vals['acc_number']))
except ValidationError:
pass
return super(ResPartnerBank, self).write(vals)

@api.one

0 comments on commit debd596

Please sign in to comment.
You can’t perform that action at this time.