summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques-Etienne Baudoux <jba@openerp.com>2014-06-27 16:47:20 +0200
committerMartin Trigaux <mat@openerp.com>2014-06-27 16:48:40 +0200
commitdf40926d2a57c101a3e2d221ecfd08fbb4fea30e (patch)
tree4aa4a45ecf5e14f390134c6ff99ac30dcb17cf0c
parent95cff0ba3426932b687db333a73b8e4ef097b0ef (diff)
[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
-rw-r--r--openerp/addons/base/res/res_partner.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/openerp/addons/base/res/res_partner.py b/openerp/addons/base/res/res_partner.py
index d43028d68ef..30d79bd7da1 100644
--- a/openerp/addons/base/res/res_partner.py
+++ b/openerp/addons/base/res/res_partner.py
@@ -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()