[FIX] base: keep mimetypes after force_storage

The write override recomputed the mimetype when changing the datas
It may give a different result

closes odoo/odoo#24397

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
Ivan Yelizariev
2019-10-03 11:04:57 +00:00
committed by Martin Trigaux
parent e479d8d73d
commit 5f9c8ced24
+2 -1
View File
@@ -65,7 +65,8 @@ class IrAttachment(models.Model):
}[self._storage()]
for attach in self.search(domain):
attach.write({'datas': attach.datas})
# pass mimetype, to avoid recomputation
attach.write({'datas': attach.datas, 'mimetype': attach.mimetype})
return True
@api.model