Drop bi views when uninstalling module

This commit is contained in:
Andrea Stirpe
2018-09-07 15:29:25 +02:00
committed by Andrea
parent 77d4f5534d
commit b699929fbb
11 changed files with 163 additions and 211 deletions

View File

@@ -270,7 +270,7 @@ class IrModel(models.Model):
@api.model
def create(self, vals):
if self._context and self._context.get('bve'):
if self.env.context and self.env.context.get('bve'):
vals['state'] = 'base'
res = super(IrModel, self).create(vals)
@@ -281,7 +281,7 @@ class IrModel(models.Model):
self.env.cr.execute(q, (res.id, ))
# # update registry
if self._context.get('bve'):
if self.env.context.get('bve'):
# setup models; this reloads custom models in registry
self.pool.setup_models(self._cr)