fix attachments_to_filesystem

This commit is contained in:
luc-demeyer 2017-05-08 18:39:11 +02:00 committed by Holger Brunn
parent cc21d5adcb
commit 721a5b9256
2 changed files with 3 additions and 3 deletions

View File

@ -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",

View File

@ -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']):