parent
e2a7ea1de5
commit
701cafe2a5
|
@ -367,7 +367,8 @@ class ir_model_access(osv.osv):
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def call_cache_clearing_methods(self):
|
def call_cache_clearing_methods(self, cr):
|
||||||
|
self.check.clear_cache(cr.dbname) # clear the cache of check function
|
||||||
for model, method in self.__cache_clearing_methods:
|
for model, method in self.__cache_clearing_methods:
|
||||||
getattr(self.pool.get(model), method)()
|
getattr(self.pool.get(model), method)()
|
||||||
|
|
||||||
|
@ -377,19 +378,16 @@ class ir_model_access(osv.osv):
|
||||||
def write(self, cr, uid, *args, **argv):
|
def write(self, cr, uid, *args, **argv):
|
||||||
self.call_cache_clearing_methods()
|
self.call_cache_clearing_methods()
|
||||||
res = super(ir_model_access, self).write(cr, uid, *args, **argv)
|
res = super(ir_model_access, self).write(cr, uid, *args, **argv)
|
||||||
self.check.clear_cache(cr.dbname) # clear the cache of check function
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def create(self, cr, uid, *args, **argv):
|
def create(self, cr, uid, *args, **argv):
|
||||||
self.call_cache_clearing_methods()
|
self.call_cache_clearing_methods()
|
||||||
res = super(ir_model_access, self).create(cr, uid, *args, **argv)
|
res = super(ir_model_access, self).create(cr, uid, *args, **argv)
|
||||||
self.check.clear_cache(cr.dbname) # clear the cache of check function
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def unlink(self, cr, uid, *args, **argv):
|
def unlink(self, cr, uid, *args, **argv):
|
||||||
self.call_cache_clearing_methods()
|
self.call_cache_clearing_methods()
|
||||||
res = super(ir_model_access, self).unlink(cr, uid, *args, **argv)
|
res = super(ir_model_access, self).unlink(cr, uid, *args, **argv)
|
||||||
self.check.clear_cache(cr.dbname) # clear the cache of check function
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
ir_model_access()
|
ir_model_access()
|
||||||
|
|
|
@ -48,7 +48,7 @@ class groups(osv.osv):
|
||||||
res = super(groups, self).write(cr, uid, ids, vals, context=context)
|
res = super(groups, self).write(cr, uid, ids, vals, context=context)
|
||||||
# Restart the cache on the company_get method
|
# Restart the cache on the company_get method
|
||||||
self.pool.get('ir.rule').domain_get.clear_cache(cr.dbname)
|
self.pool.get('ir.rule').domain_get.clear_cache(cr.dbname)
|
||||||
self.pool.get('ir.model.access').call_cache_clearing_methods()
|
self.pool.get('ir.model.access').call_cache_clearing_methods(cr)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def create(self, cr, uid, vals, context=None):
|
def create(self, cr, uid, vals, context=None):
|
||||||
|
@ -168,7 +168,7 @@ class users(osv.osv):
|
||||||
self.company_get.clear_cache(cr.dbname)
|
self.company_get.clear_cache(cr.dbname)
|
||||||
# Restart the cache on the company_get method
|
# Restart the cache on the company_get method
|
||||||
self.pool.get('ir.rule').domain_get.clear_cache(cr.dbname)
|
self.pool.get('ir.rule').domain_get.clear_cache(cr.dbname)
|
||||||
self.pool.get('ir.model.access').call_cache_clearing_methods()
|
self.pool.get('ir.model.access').call_cache_clearing_methods(cr)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def unlink(self, cr, uid, ids, context=None):
|
def unlink(self, cr, uid, ids, context=None):
|
||||||
|
|
Loading…
Reference in New Issue