[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:
Jacques-Etienne Baudoux 2014-06-27 16:47:20 +02:00 committed by Martin Trigaux
parent 95cff0ba34
commit df40926d2a
1 changed files with 1 additions and 1 deletions

View File

@ -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()