diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index d33cbf66a4..1de7850363 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -224,8 +224,9 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { cur_frm.set_df_property("cheque_no", "reqd", doc.voucher_type=="Bank Entry"); cur_frm.set_df_property("cheque_date", "reqd", doc.voucher_type=="Bank Entry"); - if((doc.accounts || []).length!==0 || !doc.company) // too early - return; + if(!doc.company) return; + + cur_frm.clear_table("accounts"); var update_jv_details = function(doc, r) { var jvdetail = frappe.model.add_child(doc, "Journal Entry Account", "accounts");