compta_file.close()
fp = BytesIO()
# workbook.save(fp)
attach_id = self.env['ir.attachment'].sudo().create(
{'name': self.writing_file_transfer+ str(self.id) + '.csv', 'type': 'binary', 'public': True,
'datas': base64.encodebytes(fp.getvalue()), })
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilidad
- Inventario
- PoS
- Project
- MRP
Se marcó esta pregunta
Hello Gowtham A,
I hope you're doing well.
The error occurs because self.writing_file_transfer is a boolean (True or False), and you're trying to concatenate it with a string (str(self.id) + '.csv'). Since Python does not allow direct concatenation of a boolean and a string, it raises a TypeError.
Convert self.writing_file_transfer to a string before concatenation:
{'name': str(self.writing_file_transfer) + str(self.id) + '.csv', 'type': 'binary', 'public': True,
'datas': base64.encodebytes(fp.getvalue()), }
I hope this resolves your issue.
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
if you check type of
self.writing_file_transfer
its may Boolean and you are trying to add Boolean and string
try this :
str(self.writing_file_transfer)
¿Le interesa esta conversación? ¡Participe en ella!
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
RegistrarsePublicaciones relacionadas | Respuestas | Vistas | Actividad | |
---|---|---|---|---|
|
0
may 24
|
1503 | ||
|
1
ago 22
|
2465 | ||
|
2
ago 25
|
1705 | ||
|
1
ago 25
|
346 | ||
|
1
jul 25
|
364 |