fix attachments_to_filesystem

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

View File

@ -20,7 +20,7 @@
############################################################################## ##############################################################################
{ {
"name": "Move existing attachments to filesystem", "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)", "author": "Therp BV,Odoo Community Association (OCA)",
"license": "AGPL-3", "license": "AGPL-3",
"complexity": "normal", "complexity": "normal",

View File

@ -86,8 +86,8 @@ class IrAttachment(models.Model):
logging.info('moving %d attachments to filestore', len(attachments)) logging.info('moving %d attachments to filestore', len(attachments))
# attachments can be big, so we read every attachment on its own # attachments can be big, so we read every attachment on its own
for counter, attachment_id in enumerate(attachments.ids, start=1): for counter, attachment_id in enumerate(attachments.ids, start=1):
attachment_data = ir_attachment.read( attachment_data = self.pool['ir.attachment'].read(
[attachment_id], ['datas', 'res_model'] self._cr, self._uid, [attachment_id], ['datas', 'res_model']
)[0] )[0]
if attachment_data['res_model'] and not self.env.registry.get( if attachment_data['res_model'] and not self.env.registry.get(
attachment_data['res_model']): attachment_data['res_model']):