parent
e2a7ea1de5
commit
701cafe2a5
|
@ -367,7 +367,8 @@ class ir_model_access(osv.osv):
|
|||
except ValueError:
|
||||
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:
|
||||
getattr(self.pool.get(model), method)()
|
||||
|
||||
|
@ -377,19 +378,16 @@ class ir_model_access(osv.osv):
|
|||
def write(self, cr, uid, *args, **argv):
|
||||
self.call_cache_clearing_methods()
|
||||
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
|
||||
|
||||
def create(self, cr, uid, *args, **argv):
|
||||
self.call_cache_clearing_methods()
|
||||
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
|
||||
|
||||
def unlink(self, cr, uid, *args, **argv):
|
||||
self.call_cache_clearing_methods()
|
||||
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
|
||||
|
||||
ir_model_access()
|
||||
|
|
|
@ -48,7 +48,7 @@ class groups(osv.osv):
|
|||
res = super(groups, self).write(cr, uid, ids, vals, context=context)
|
||||
# Restart the cache on the company_get method
|
||||
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
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
|
@ -168,7 +168,7 @@ class users(osv.osv):
|
|||
self.company_get.clear_cache(cr.dbname)
|
||||
# Restart the cache on the company_get method
|
||||
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
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
|
|
Loading…
Reference in New Issue