Merge pull request #12944 from alyf-de/report_column_context

This commit is contained in:
Suraj Shetty 2021-05-03 13:47:46 +05:30 committed by GitHub
commit ce10753e91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -1094,7 +1094,7 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
return Object.assign(column, {
id: column.fieldname,
name: __(column.label),
name: __(column.label, null, `Column of report '${this.report_name}'`), // context has to match context in get_messages_from_report in translate.py
width: parseInt(column.width) || null,
editable: false,
compareValue: compareFn,

View file

@ -444,7 +444,8 @@ def get_messages_from_report(name):
frappe.db.get_value("DocType", report.ref_doctype, "module"))
if report.columns:
messages.extend([(None, report_column.label) for report_column in report.columns])
context = "Column of report '%s'" % report.name # context has to match context in `prepare_columns` in query_report.js
messages.extend([(None, report_column.label, context) for report_column in report.columns])
if report.filters:
messages.extend([(None, report_filter.label) for report_filter in report.filters])