[IMP] res_partner: more fault tolerant name_create
In case of invalid format such as 'name email@server' (missing chevrons), the parsing would be failing due to a strict behaviour of getaddresses (returns nameemail@server). With the patch this format is accepted. opw 607312
This commit is contained in:
parent
95cff0ba34
commit
df40926d2a
|
@ -559,7 +559,7 @@ class res_partner(osv.osv, format_address):
|
|||
""" Supported syntax:
|
||||
- 'Raoul <raoul@grosbedon.fr>': will find name and email address
|
||||
- otherwise: default, everything is set as the name """
|
||||
emails = tools.email_split(text)
|
||||
emails = tools.email_split(text.replace(' ',','))
|
||||
if emails:
|
||||
email = emails[0]
|
||||
name = text[:text.index(email)].replace('"', '').replace('<', '').strip()
|
||||
|
|
Loading…
Reference in New Issue