[FIX] web: fix array values export
- Install Sales and Accounting - Go to Sales > Orders > Quotations - Create a new quotation - Add a product and in Order Line form, select a tax - Save the Order Line - Save the quotation - Go back to quotation list - Select (checkbox) the created quotation - Select "Export" in Action menu - In export wizard, choose "Excel" format and add field "Tax amount by group" - Validate with "EXPORT TO FILE" An error is triggered. The issue comes from the fact that the value of "amount_by_group" is an array of tuples and "xlwt" cannot write that type of value. opw-2255054 closes odoo/odoo#51480 X-original-commit: dde2ca9943362b20853ab11b15fe1504c0b8d848 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -1959,6 +1959,8 @@ class ExcelExport(ExportFormat, http.Controller):
|
||||
with ExportXlsxWriter(fields, len(rows)) as xlsx_writer:
|
||||
for row_index, row in enumerate(rows):
|
||||
for cell_index, cell_value in enumerate(row):
|
||||
if isinstance(cell_value, (list, tuple)):
|
||||
cell_value = pycompat.to_text(cell_value)
|
||||
xlsx_writer.write_cell(row_index + 1, cell_index, cell_value)
|
||||
|
||||
return xlsx_writer.value
|
||||
|
||||
Reference in New Issue
Block a user