From fa5f86f3366a6ef7bcba4046428e2a610b072e96 Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Wed, 30 Sep 2015 23:42:22 +0200 Subject: [PATCH] [FIX] ir_qweb: useless test in js bundle generation If one of the javascript files of the bundle has been modified since the bundle generation, we are sure that get_attachments will return an empty list because it searches with the version of the bundle which takes into account the last modification of any of the bundle's content. Also, this check is not present in the css bundle generation. --- openerp/addons/base/ir/ir_qweb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_qweb.py b/openerp/addons/base/ir/ir_qweb.py index 9d57ae82541..a0e99c96c3b 100644 --- a/openerp/addons/base/ir/ir_qweb.py +++ b/openerp/addons/base/ir/ir_qweb.py @@ -1249,7 +1249,7 @@ class AssetsBundle(object): def js(self): attachments = self.get_attachments('js') - if not attachments or attachments[0]['__last_update'] < Datetime.to_string(max([asset.last_modified for asset in self.javascripts])): + if not attachments: content = ';\n'.join(asset.minify() for asset in self.javascripts) return self.save_attachment('js', content) return attachments[0]