mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-26 18:38:41 -06:00
[FIX] ignore exceptions when moving attachment
This commit is contained in:
parent
790c568b86
commit
1f486da4cd
@ -102,12 +102,15 @@ class IrAttachment(Model):
|
|||||||
'not moving attachment %d because it links to unknown '
|
'not moving attachment %d because it links to unknown '
|
||||||
'model %s', attachment_id, attachment_data['res_model'])
|
'model %s', attachment_id, attachment_data['res_model'])
|
||||||
continue
|
continue
|
||||||
ir_attachment.write(
|
try:
|
||||||
cr, uid, [attachment_id],
|
ir_attachment.write(
|
||||||
{
|
cr, uid, [attachment_id],
|
||||||
'datas': attachment_data['datas'],
|
{
|
||||||
'db_datas': False,
|
'datas': attachment_data['datas'],
|
||||||
},
|
'db_datas': False,
|
||||||
context=context)
|
},
|
||||||
|
context=context)
|
||||||
|
except Exception:
|
||||||
|
logging.exception('Error moving attachment #%d', attachment_id)
|
||||||
if not counter % (len(attachment_ids) / 100 or limit):
|
if not counter % (len(attachment_ids) / 100 or limit):
|
||||||
logging.info('moving attachments: %d done', counter)
|
logging.info('moving attachments: %d done', counter)
|
||||||
|
Loading…
Reference in New Issue
Block a user