Skip to content

Commit

Permalink
fix: check page obj before adding menu
Browse files Browse the repository at this point in the history
(cherry picked from commit 2486b64)
  • Loading branch information
GursheenK authored and mergify[bot] committed Jan 29, 2024
1 parent a118417 commit 0aa73e3
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions erpnext/public/js/financial_statements.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,24 @@ erpnext.financial_statements = {
});
});

const views_menu = report.page.add_custom_button_group(__('Financial Statements'));
if (report.page){
const views_menu = report.page.add_custom_button_group(__('Financial Statements'));

report.page.add_custom_menu_item(views_menu, __("Balance Sheet"), function() {
var filters = report.get_values();
frappe.set_route('query-report', 'Balance Sheet', {company: filters.company});
});
report.page.add_custom_menu_item(views_menu, __("Balance Sheet"), function() {
var filters = report.get_values();
frappe.set_route('query-report', 'Balance Sheet', {company: filters.company});
});

report.page.add_custom_menu_item(views_menu, __("Profit and Loss"), function() {
var filters = report.get_values();
frappe.set_route('query-report', 'Profit and Loss Statement', {company: filters.company});
});
report.page.add_custom_menu_item(views_menu, __("Profit and Loss"), function() {
var filters = report.get_values();
frappe.set_route('query-report', 'Profit and Loss Statement', {company: filters.company});
});

report.page.add_custom_menu_item(views_menu, __("Cash Flow Statement"), function() {
var filters = report.get_values();
frappe.set_route('query-report', 'Cash Flow', {company: filters.company});
});
report.page.add_custom_menu_item(views_menu, __("Cash Flow Statement"), function() {
var filters = report.get_values();
frappe.set_route('query-report', 'Cash Flow', {company: filters.company});
});
}
}
};

Expand Down

0 comments on commit 0aa73e3

Please sign in to comment.