[FIX] Importation when fails,needs cursor to be rolled back

bzr revid: jvo@tinyerp.com-20091214095643-2ykgs3849tj7smzj
This commit is contained in:
Jay (Open ERP)
2009-12-14 15:26:43 +05:30
parent 1f8e9f84c8
commit 4fbb8d0952
+2
View File
@@ -843,6 +843,8 @@ class orm_template(object):
except Exception, e:
import psycopg2
import osv
#Needed to rollback the cursor for letting the _('text') work
cr.rollback()
if isinstance(e,psycopg2.IntegrityError):
msg= _('Insertion Failed! ')
for key in self.pool._sql_error.keys():