Provides a field to store bytes as a file in the filestore. This fields are useful with data values too large to be manipulated conveniently as a whole and a way to keep the database slim since it only has to save the path to the file and not the content itself.
from odoo.addons.muk_fields_file.fields.file import File
class FileModel(models.Model):
data_content = File(string="Data")
def data(self):
for record in self:
base64 = record.data_content
oid = record.with_context({'path': True}).data_content
size = record.with_context({'bin_size': True}).data_content
bytes = record.with_context({'bytes': True}).data_content
stream = record.with_context({'stream': True}).data_content