mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-26 18:38:41 -06:00
fix attachments_to_filesystem
This commit is contained in:
parent
cc21d5adcb
commit
d23fa1c714
@ -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",
|
||||||
|
@ -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']):
|
||||||
|
Loading…
Reference in New Issue
Block a user