Skip to content

Commit

Permalink
fix: report print view not working (#21002) (#21003)
Browse files Browse the repository at this point in the history
```
report_view.js:1353 Uncaught TypeError: Cannot read properties of undefined (reading 'label')
    at report_view.js:1353:31
    at Array.map (<anonymous>)
    at frappe.views.ReportView.get_filters_html_for_print (report_view.js:1349:5)
    at report_view.js:1414:23
    at print_utils.js:67:4
    at frappe.ui.Dialog.<anonymous> (messages.js:104:4)
    at HTMLButtonElement.<anonymous> (dialog.js:165:20)
    at HTMLButtonElement.dispatch (jquery.js:5430:27)
    at c1.handle (jquery.js:5234:28)
```

[skip ci]

(cherry picked from commit 73276a2)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed May 15, 2023
1 parent 43b051f commit ca73d72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frappe/public/js/frappe/views/reports/report_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1298,9 +1298,10 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView {
return filters
.map((f) => {
const [doctype, fieldname, condition, value] = f;
if (condition !== '=') return '';
if (condition !== "=") return "";
const label = frappe.meta.get_label(doctype, fieldname);
const docfield = frappe.meta.get_docfield(doctype, fieldname);
return `<h6>${__(docfield.label)}: ${frappe.format(value, docfield)}</h6>`;
return `<h6>${__(label)}: ${frappe.format(value, docfield)}</h6>`;
})
.join("");
}
Expand Down

0 comments on commit ca73d72

Please sign in to comment.