I have a wizard with a binary field where I upload a file and a method that opens it.
excel_file_for_import = fields.Binary(string='import file') file_name_for_import = fields.Char(string='file name')
@api.multi
def open_file(self):
book = open_workbook(base64.decodestring(self.excel_file_for_import))
...
And the 1st line in the method throws an error:
TypeError: file() argument 1 must be encoded string without NULL bytes, not str
So what I'm doing wrong?