From d23fa1c71477e54cd3983fa64c74cd36b10ec37b Mon Sep 17 00:00:00 2001 From: luc-demeyer Date: Mon, 8 May 2017 18:39:11 +0200 Subject: [PATCH] fix attachments_to_filesystem --- attachments_to_filesystem/__openerp__.py | 2 +- attachments_to_filesystem/models/ir_attachment.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/attachments_to_filesystem/__openerp__.py b/attachments_to_filesystem/__openerp__.py index f7732024..d94af6cd 100644 --- a/attachments_to_filesystem/__openerp__.py +++ b/attachments_to_filesystem/__openerp__.py @@ -20,7 +20,7 @@ ############################################################################## { "name": "Move existing attachments to filesystem", - "version": "8.0.1.0.0", + "version": "8.0.1.0.1", "author": "Therp BV,Odoo Community Association (OCA)", "license": "AGPL-3", "complexity": "normal", diff --git a/attachments_to_filesystem/models/ir_attachment.py b/attachments_to_filesystem/models/ir_attachment.py index b9bd4e49..880b4c57 100644 --- a/attachments_to_filesystem/models/ir_attachment.py +++ b/attachments_to_filesystem/models/ir_attachment.py @@ -86,8 +86,8 @@ class IrAttachment(models.Model): logging.info('moving %d attachments to filestore', len(attachments)) # attachments can be big, so we read every attachment on its own for counter, attachment_id in enumerate(attachments.ids, start=1): - attachment_data = ir_attachment.read( - [attachment_id], ['datas', 'res_model'] + attachment_data = self.pool['ir.attachment'].read( + self._cr, self._uid, [attachment_id], ['datas', 'res_model'] )[0] if attachment_data['res_model'] and not self.env.registry.get( attachment_data['res_model']):