Skip to content
Snippets Groups Projects
Commit 46aba6d80afd authored by oury.balde's avatar oury.balde
Browse files

[add] new helper func in document attachment model

Note that now we can use this method to retrieve metadata from attachments.
parent 37403acbc7a3
No related branches found
Tags 13.0.1.0.1
No related merge requests found
......@@ -80,3 +80,20 @@
attachments.unlink()
return ret
@api.multi
def get_metadata(self):
"""Helper function returning the document attachment metadata
Can be overridden to add some specifics metadata
"""
self.ensure_one()
return {
"size": self.file_size,
"type": self.mimetype,
"filename": self.datas_fname,
"hash": ["sha1:%s" % self.checksum],
"encoding": "",
"customtype": self.type_id.name,
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment