[IMP]Improved code for the base_import requirde field

bzr revid: pan@tinyerp.com-20130201102750-ozxa3xwqa4rsnt60
This commit is contained in:
Anand Patel (OpenERP) 2013-02-01 15:57:50 +05:30
parent 4144c0fc76
commit a52d21e1cb
1 changed files with 1 additions and 3 deletions

View File

@ -5318,11 +5318,9 @@ def convert_pgerror_23502(model, fields, info, e):
field_name = m.group('field')
if not m or field_name not in fields:
return {'message': unicode(e)}
message = _(u"Missing required value for the field '%s'.") % field_name
field = fields.get(field_name)
if field:
message = _(u"%s This might be '%s' in the current model, or a field "
u"of the same name in an o2m.") % (message, field['string'])
message = _(u"Missing required value for the field '%s'") % (field['string'])
return {
'message': message,
'field': field_name,