with open('WHOUSE.txt', 'r') as f_read:
file_data = f_read.read()
print 'file_data', file_data
data_encode = file_data.encode('utf8').encode('base64')
data_decode = data_encode.decode('base64','strict')
print 'data_decode',data_decode
values = {
'name': 'WHOUSE.txt',
'datas_fname': 'WHOUSE.txt',
'res_model': 'ir.ui.view',
'res_id': False,
'type': 'binary',
'public': True,
'datas': data_decode,
}
I think i have a problem in decoding, I don't which part and what do I do.