summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Yelizariev <yelizariev@it-projects.info>2018-04-24 15:08:54 +0000
committerMartin Trigaux <mat@odoo.com>2019-10-03 11:04:57 +0000
commit5f9c8ced24ac1c8a65c04f745ad2ea3bb1125c99 (patch)
tree58d483b1eb351df8884876ea0f54b228944dce76
parente479d8d73df534857008fbedf897b02530b0a813 (diff)
[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>
-rw-r--r--odoo/addons/base/models/ir_attachment.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/odoo/addons/base/models/ir_attachment.py b/odoo/addons/base/models/ir_attachment.py
index a58ba54c448..4ccdc29b184 100644
--- a/odoo/addons/base/models/ir_attachment.py
+++ b/odoo/addons/base/models/ir_attachment.py
@@ -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