add conditionnal mimetype upload file s3

This commit is contained in:
cyrilmanuel
2023-01-25 14:29:00 +01:00
parent 6dd6d71807
commit d373948dbe
2 changed files with 9 additions and 1 deletions
@@ -164,6 +164,10 @@ class IrAttachment(models.Model):
return len(bin_data) <= limit
return False
def _get_datas_related_values(self, data, mimetype):
self=self.with_context(mimetype=mimetype)
return super(IrAttachment, self)._get_datas_related_values(data, mimetype)
def _inverse_datas(self):
# override in order to store files that need fast access,
# we keep them in the database instead of the object storage