summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2011-01-17 20:32:34 +0100
committerChristophe Simonis <chs@openerp.com>2011-01-17 20:32:34 +0100
commit61bafa269f343fa98547d5cecd36432b41a8799b (patch)
tree2b9f95a2cb9cda7a8e98f481293377aa8daa2fd6
parent1b7230e2e50c9a82768c917d71f55ec51c0d499a (diff)
[FIX] web_livechat: clear cache at create/write/unlink
bzr revid: chs@openerp.com-20110117193234-6ywxa2dcian1l0wl
-rw-r--r--addons/web_livechat/publisher_warranty.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/addons/web_livechat/publisher_warranty.py b/addons/web_livechat/publisher_warranty.py
index 07f5430a136..ab83bc58c32 100644
--- a/addons/web_livechat/publisher_warranty.py
+++ b/addons/web_livechat/publisher_warranty.py
@@ -22,9 +22,21 @@
from osv import osv
from tools import cache
+def _gen_cache_clear(method):
+ def func(self, cr, *args, **kwargs):
+ s = super(publisher_warranty_contract, self)
+ r = getattr(s, method)(cr, *args, **kwargs)
+ self.is_livechat_enable.clear_cache(cr.dbname)
+ return r
+ return func
+
class publisher_warranty_contract(osv.osv):
_inherit = 'publisher_warranty.contract'
+ create = _gen_cache_clear('create')
+ write = _gen_cache_clear('write')
+ unlink = _gen_cache_clear('unlink')
+
@cache(skiparg=3, timeout=300)
def is_livechat_enable(self, cr, uid):
domain = [('state', '=', 'valid'), ('check_support', '=', True)]