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")
+
+ @api.multi
+ def data(self):
+ for record in self:
+ bytes = record.data_content
+ oid = record.with_context({'path': True}).data_content
+ size = record.with_context({'bin_size': True}).data_content
+ base64 = record.with_context({'base64': True}).data_content
+ stream = record.with_context({'stream': True}).data_content
+
+
+