[FIX] Manage jsonb fields

This commit is contained in:
Florian da Costa
2023-03-03 10:05:02 +01:00
parent 36aaf3e871
commit fe71ae7bce

View File

@@ -110,6 +110,9 @@ class SqlExport(models.Model):
col_position = 1
for index, row in enumerate(res, row_position):
for col, val in enumerate(row, col_position):
# manage jsonb field as dict are not writable on the excel cell
if isinstance(val, dict):
val = str(val)
ws.cell(row=index, column=col).value = val
output = BytesIO()
wb.save(output)