[FIX]: orm: reverted a change in a previous commit (where a try/except was removed).

bzr revid: vmt@openerp.com-20120810120936-13lewpbjn7euveg0
This commit is contained in:
Vo Minh Thu 2012-08-10 14:09:36 +02:00
parent e70f7eaab5
commit d1d6203f4f
1 changed files with 5 additions and 1 deletions

View File

@ -4191,7 +4191,11 @@ class BaseModel(object):
# Try-except added to filter the creation of those records whose filds are readonly.
# Example : any dashboard which has all the fields readonly.(due to Views(database views))
cr.execute("SELECT nextval('"+self._sequence+"')")
try:
cr.execute("SELECT nextval('"+self._sequence+"')")
except:
raise except_orm(_('UserError'),
_('You cannot perform this operation. New Record Creation is not allowed for this object as this object is for reporting purpose.'))
id_new = cr.fetchone()[0]
for table in tocreate: