mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[FIX] fix typos in (seldomly triggered) get_or_create_partner code
This commit is contained in:
committed by
Stefan Rijnhart
parent
179a122ae4
commit
7557c33125
@@ -46,9 +46,7 @@ class PostalCode(object):
|
||||
'''
|
||||
# Sort formats on length, longest first
|
||||
formats = [(len(x), x) for x in format.split('|')]
|
||||
formats.sort()
|
||||
formats.reverse()
|
||||
formats = [x[1] for x in formats]
|
||||
formats = [x[1] for x in sorted(formats, lambda x,y: -cmp(x,y))]
|
||||
self.res = [re.compile(x.replace('#', '\\d').replace('@','[A-Z]'))
|
||||
for x in formats
|
||||
]
|
||||
|
||||
@@ -138,9 +138,9 @@ def get_or_create_partner(pool, cursor, uid, name, address, postal_code, city,
|
||||
filter.append(('country_id', '=', country_id))
|
||||
if address:
|
||||
if len(address) >= 1:
|
||||
filter.append(('street', 'ilike', addres[0]))
|
||||
filter.append(('street', 'ilike', address[0]))
|
||||
if len(address) > 1:
|
||||
filter.append(('street2', 'ilike', addres[1]))
|
||||
filter.append(('street2', 'ilike', address[1]))
|
||||
if city:
|
||||
filter.append(('city', 'ilike', city))
|
||||
if postal_code:
|
||||
|
||||
Reference in New Issue
Block a user