Download zip file on button click in Odoo
The scenario is we have an attachment or file (in binary format) in our database (PostgreSQL) and we want to download that file or attachment in .zip or .rar extension on button click. To do that I am going to use python library named "zipfile". This is python standard library, so we don't need to install it explicitly.
Don,t forgot to share, keep sharing keep learning
7 Comments
object_name = self.binary_field_name
ReplyDeletehere what binary_field_name contains can you please tell me
in odoo binary field looks like
Deleteattachment = fields.Binary(string='Attachment')
that contains files
hi, is there a way to download a file from other website and pass to user, without save to server?
ReplyDeleteyes you can use xml-rpc for this
DeleteHello dear, please whats the difference between the self.attachment and self.binary_field_name?
ReplyDeletedear there is no difference, actually self.attachment is a binary field name nothing else...
Deleteattachment = fields.Binary(string='Attachment')
Hello dear, please; whats de difference between self.binary_field_name and self.attachment?
ReplyDelete