Browse Source

[FIX] Remove use of cr.commit() directly

pull/59/head
Andrea Stirpe 9 years ago
committed by Andrea
parent
commit
1af4c64194
  1. 6
      bi_view_editor/models/bve_view.py

6
bi_view_editor/models/bve_view.py

@ -255,10 +255,14 @@ class BveView(models.Model):
[x for x in self.name.lower() [x for x in self.name.lower()
if x.isalnum()]).replace("_", ".").replace(" ", ".") if x.isalnum()]).replace("_", ".").replace(" ", ".")
try:
with self.env.cr.savepoint():
_build_query() _build_query()
obj = _build_object() obj = _build_object()
_build_access_rules(obj) _build_access_rules(obj)
self.env.cr.commit()
except Exception, e:
raise UserError(
_('Generic error. Unable to create the view!'))
from openerp.modules.registry import RegistryManager from openerp.modules.registry import RegistryManager
self.env.registry = RegistryManager.new(self.env.cr.dbname) self.env.registry = RegistryManager.new(self.env.cr.dbname)

Loading…
Cancel
Save