[FIX] orm.browse_record: avoid printing unrelated traceback upon KeyError

bzr revid: odo@openerp.com-20111007144944-j4obwcbvx9awkj30
This commit is contained in:
Olivier Dony 2011-10-07 16:49:44 +02:00
parent 5aca6a91fa
commit d86c283434
1 changed files with 3 additions and 5 deletions

View File

@ -374,11 +374,9 @@ class browse_record(object):
else:
return attr
else:
self.logger.notifyChannel("browse_record", netsvc.LOG_WARNING,
"Field '%s' does not exist in object '%s': \n%s" % (
name, self, ''.join(traceback.format_exc())))
raise KeyError("Field '%s' does not exist in object '%s'" % (
name, self))
error_msg = "Field '%s' does not exist in object '%s'" % (name, self)
self.logger.notifyChannel("browse_record", netsvc.LOG_WARNING, error_msg)
raise KeyError(error_msg)
# if the field is a classic one or a many2one, we'll fetch all classic and many2one fields
if col._prefetch: