Merge pull request #31693 from iamejaaz/query-report-translate
fix: report header not translated
This commit is contained in:
commit
91430efdbb
1 changed files with 7 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue