[FIX] base: disable cache in dev mode for read_template

Without it, the xml template are not refreshed when file is changed.

A better way will be to invalide cache when XML file is modified.
Same way that we restart the server when a python file is updated.
This commit is contained in:
Jeremy Kersten
2015-04-15 16:32:16 +02:00
parent 32389f0073
commit fe4df440a0
+3 -1
View File
@@ -153,6 +153,7 @@ class view(osv.osv):
def _arch_get(self, cr, uid, ids, name, arg, context=None):
result = {}
for view in self.browse(cr, uid, ids, context=context):
arch_fs = None
if config['dev_mode'] and view.arch_fs and view.xml_id:
@@ -923,7 +924,8 @@ class view(osv.osv):
_read_template_cache = dict(accepted_keys=('lang','inherit_branding', 'editable', 'translatable'))
if config['dev_mode']:
_read_template_cache['size'] = 0
@tools.ormcache_context(**_read_template_cache)
@tools.conditional(not tools.config['dev_mode'], tools.ormcache_context(**_read_template_cache))
def _read_template(self, cr, uid, view_id, context=None):
arch = self.read_combined(cr, uid, view_id, fields=['arch'], context=context)['arch']
arch_tree = etree.fromstring(arch)