mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
[IMP]: Allow to use context Key as storage key
This commit is contained in:
@@ -156,7 +156,9 @@ class IrAttachment(models.Model):
|
|||||||
location = self.env.context.get('storage_location') or self._storage()
|
location = self.env.context.get('storage_location') or self._storage()
|
||||||
if location in self._get_stores():
|
if location in self._get_stores():
|
||||||
bin_data = base64.b64decode(value)
|
bin_data = base64.b64decode(value)
|
||||||
key = self._compute_checksum(bin_data)
|
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)
|
filename = self._store_file_write(key, bin_data)
|
||||||
else:
|
else:
|
||||||
filename = super(IrAttachment, self)._file_write(value, checksum)
|
filename = super(IrAttachment, self)._file_write(value, checksum)
|
||||||
|
|||||||
Reference in New Issue
Block a user