[FIX] res_partner: not always have a context.

bzr revid: tde@openerp.com-20120903174829-epc4nyiyavdppsbu
This commit is contained in:
Thibault Delavallée 2012-09-03 19:48:29 +02:00
parent 12294252d4
commit 1bcad78c99
1 changed files with 2 additions and 0 deletions

View File

@ -380,6 +380,8 @@ class res_partner(osv.osv):
If only an email address is received and that the regex cannot find
a name, the name will have the email value.
If 'force_email' key in context: must find the email address. """
if context is None:
context = {}
name, email = self._parse_partner_name(name, context=context)
if context.get('force_email') and not email:
raise osv.except_osv(_('Warning'), _("Couldn't create contact without email address !"))