Skip to content
Closed
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions export_bg/models/export_bg_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ def _export_chunk_bg(self, data, export_id, export_format):

# Extract field names considering import_compat mode
import_compat = params.get("import_compat", True)
field_names = [f["name"] for f in params["fields"]]
field_names = [f.get("name") or f.get("value") or f.get("id") for f in params["fields"]]
if import_compat:
field_labels = field_names
else:
field_labels = [((f.get("label") or "").strip()) for f in params["fields"]]
field_names = [f.get("name") or f.get("id") for f in params["fields"]]
field_labels = [f.get("label") or f.get("string") for f in params["fields"]]
Comment thread
rov-adhoc marked this conversation as resolved.

export_data = self.export_data(field_names).get("datas", [])

Expand Down
2 changes: 2 additions & 0 deletions export_bg/static/src/views/list_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ patch(ListController.prototype, {
const recordCount = resIds ? resIds.length : (this.model.root.count || 0);
const exportedFields = fields.map((field) => ({
name: field.name || field.id,
value: field.name || field.id,
label: field.label || field.string,
string: field.label || field.string,
store: field.store,
type: field.field_type || field.type,
}));
Expand Down
Loading