From c3c2281a4d6a148cebf4eed2d6ab894eedbf472c Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Wed, 30 Sep 2015 17:05:30 +0200 Subject: [PATCH] [FIX] ir_qweb: add id to ir.attachment mock fixes #8762 --- openerp/addons/base/ir/ir_qweb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/ir/ir_qweb.py b/openerp/addons/base/ir/ir_qweb.py index f65e60f5900..6764afe7d51 100644 --- a/openerp/addons/base/ir/ir_qweb.py +++ b/openerp/addons/base/ir/ir_qweb.py @@ -41,7 +41,7 @@ from openerp.modules.module import get_resource_path _logger = logging.getLogger(__name__) MAX_CSS_RULES = 4095 -MOCK_ATTACH = namedtuple('mock_attach', ['url', 'last_update']) +MOCK_ATTACH = namedtuple('mock_attach', ['id', 'url', 'last_update']) #-------------------------------------------------------------------- # QWeb template engine @@ -1229,7 +1229,7 @@ class AssetsBundle(object): transaction. But there's another tweak: a recordset browsed with a closed cursor becomes unusable. We chose to copy their content in a namedtuple. """ - return [MOCK_ATTACH(attachment.url, attachment['__last_update']) for attachment in attachments] + return [MOCK_ATTACH(attachment.id, attachment.url, attachment['__last_update']) for attachment in attachments] def get_attachments(self, type, inc=None): ira = self.registry['ir.attachment']