Merge branch 'imp/12.0/attachment_minio__mimetype' into '12.0'

imp/12.0/attachment_minio__mimetype into 12.0

See merge request hibou-io/hibou-odoo/suite!359
This commit is contained in:
Jared Kipe
2020-08-26 19:23:43 +00:00

View File

@@ -85,7 +85,10 @@ class MinioAttachment(models.Model):
client = self._get_minio_client()
bucket = self._get_minio_bucket(client)
minio_key = self._get_minio_key(key)
client.put_object(bucket, minio_key, io.BytesIO(bin_data), len(bin_data))
client.put_object(
bucket, minio_key, io.BytesIO(bin_data), len(bin_data),
content_type=self.mimetype,
)
return self._get_minio_fname(bucket, minio_key)
return super(MinioAttachment, self)._store_file_write(key, bin_data)