diff --git a/erpnext/public/js/financial_statements.js b/erpnext/public/js/financial_statements.js index 959cf507d53d..907a775bfa53 100644 --- a/erpnext/public/js/financial_statements.js +++ b/erpnext/public/js/financial_statements.js @@ -6,8 +6,10 @@ erpnext.financial_statements = { if (data && column.fieldname=="account") { value = data.account_name || value; - column.link_onclick = - "erpnext.financial_statements.open_general_ledger(" + JSON.stringify(data) + ")"; + if (data.account) { + column.link_onclick = + "erpnext.financial_statements.open_general_ledger(" + JSON.stringify(data) + ")"; + } column.is_tree = true; }