From 95ec1faf1435f29c869fdcc03b79b8f1634e6b9c Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 19 Aug 2014 17:16:09 +0200 Subject: [PATCH] [FIX] ir.attachments of compiled css assets not properly invalidated --- openerp/addons/base/ir/ir_qweb.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openerp/addons/base/ir/ir_qweb.py b/openerp/addons/base/ir/ir_qweb.py index b4352fcc32c..8116ef61bfd 100644 --- a/openerp/addons/base/ir/ir_qweb.py +++ b/openerp/addons/base/ir/ir_qweb.py @@ -1423,14 +1423,15 @@ class PreprocessedCSS(StylesheetAsset): if self.url: ira = self.registry['ir.attachment'] url = self.html_url % self.url - domain = [('type', '=', 'binary'), ('url', '=', self.url)] + domain = [('type', '=', 'binary'), ('url', '=', url)] ira_id = ira.search(self.cr, self.uid, domain, context=self.context) + datas = self.content.encode('utf8').encode('base64') if ira_id: # TODO: update only if needed - ira.write(self.cr, openerp.SUPERUSER_ID, [ira_id], {'datas': self.content}, context=self.context) + ira.write(self.cr, openerp.SUPERUSER_ID, ira_id, {'datas': datas}, context=self.context) else: ira.create(self.cr, openerp.SUPERUSER_ID, dict( - datas=self.content.encode('utf8').encode('base64'), + datas=datas, mimetype='text/css', type='binary', name=url,