[FIX] ignore exceptions when moving attachment

This commit is contained in:
Holger Brunn 2017-04-02 12:30:18 +02:00
parent 790c568b86
commit 1f486da4cd

View File

@ -102,6 +102,7 @@ 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
try:
ir_attachment.write( ir_attachment.write(
cr, uid, [attachment_id], cr, uid, [attachment_id],
{ {
@ -109,5 +110,7 @@ class IrAttachment(Model):
'db_datas': False, '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)