[IMP]: Allow to use context Key as storage key

This commit is contained in:
Akim Juillerat
2019-03-11 15:39:53 +01:00
parent 498aae2f53
commit 626c157964
@@ -156,6 +156,8 @@ class IrAttachment(models.Model):
location = self.env.context.get('storage_location') or self._storage()
if location in self._get_stores():
bin_data = base64.b64decode(value)
key = self.env.context.get('force_storage_key')
if not key:
key = self._compute_checksum(bin_data)
filename = self._store_file_write(key, bin_data)
else: