Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion base_import_async/models/base_import_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ def _create_csv_attachment(self, fields, data, options, file_name):
encoding = options.get(OPT_ENCODING) or "utf-8"
writer.writerow(fields)
for row in data:
writer.writerow(row)
cleaned_row = []
for cell in row:
if isinstance(cell, (bytes, bytearray)):
cell = cell.decode("utf-8")
cleaned_row.append(cell)
writer.writerow(cleaned_row)
# create attachment. Remove default values from context
context = self.env.context
context_copy = {}
Expand Down
Loading