From d1d6203f4f9c546396f777401f0cdfea8a1af28c Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Fri, 10 Aug 2012 14:09:36 +0200 Subject: [PATCH] [FIX]: orm: reverted a change in a previous commit (where a try/except was removed). bzr revid: vmt@openerp.com-20120810120936-13lewpbjn7euveg0 --- openerp/osv/orm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 2f850e23607..563c514726c 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -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: