diff --git a/frappe/public/js/frappe/views/reports/query_report.js b/frappe/public/js/frappe/views/reports/query_report.js index 4cd20749ee..696590199c 100644 --- a/frappe/public/js/frappe/views/reports/query_report.js +++ b/frappe/public/js/frappe/views/reports/query_report.js @@ -1231,6 +1231,10 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { } prepare_columns(columns) { + let is_query_generated_report = + this.report_doc.query && + this.report_doc.query != undefined && + this.report_doc.query != ""; return columns.map((column) => { column = frappe.report_utils.prepare_field_from_column(column); @@ -1279,7 +1283,9 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { id: column.fieldname, // The column label should have already been translated in the // backend. Translating it again would cause unexpected behaviour. - name: column.label, + + // Translating based on condition: when a report is generated through a query, the label is not translated. + name: is_query_generated_report ? __(column.label) : column.label, width: parseInt(column.width) || null, editable: column.editable ?? false, compareValue: compareFn,