diff --git a/bi_sql_editor/models/bi_sql_view.py b/bi_sql_editor/models/bi_sql_view.py index 17992f06..293644e1 100644 --- a/bi_sql_editor/models/bi_sql_view.py +++ b/bi_sql_editor/models/bi_sql_view.py @@ -449,6 +449,7 @@ class BiSQLView(models.Model): # Drop table, created by the ORM req = "DROP TABLE %s" % (sql_view.view_name) self.env.cr.execute(req) + self.env.cr.commit() # pylint: disable=invalid-commit @api.multi def _create_model_access(self): @@ -481,6 +482,7 @@ class BiSQLView(models.Model): AND attnum > 0 ORDER BY attnum;""" % (self.view_name) self.env.cr.execute(req) + self.env.cr.commit() # pylint: disable=invalid-commit return self.env.cr.fetchall() @api.multi @@ -556,8 +558,8 @@ class BiSQLView(models.Model): self._log_execute(req) sql_view._refresh_size() if sql_view.action_id: - # Alter name of the action, to display last refresh datetime - # of the materialized view + # Alter name of the action, to display last refresh + # datetime of the materialized view sql_view.action_id.name = "%s (%s)" % ( self.name, datetime.utcnow().strftime(_("%m/%d/%Y %H:%M:%S UTC"))) @@ -569,3 +571,4 @@ class BiSQLView(models.Model): sql_view.view_name) self.env.cr.execute(req) sql_view.size = self.env.cr.fetchone()[0] + self.env.cr.commit() # pylint: disable=invalid-commit