I need to import a zip file that will contain only xml files.
My wizard looks like this:
class ZipImportsWizard(models.Model):
_name = 'import.zip.dte'
type = fields.Selection([('purchase', 'Purchases'),('sale', 'Sales'),], string="Type", default="purchase")
file = fields.Binary(string='ZIP File', store=True)
I need to open this zip file and check the content. If the content is OK, I have to send this to another method.
The problem is, when I upload the file, it converts to a Binary file, so I can't user zipfile library to work with it.
How can I convert this Binary file to a Zip file again to work with it?