From c34329284b8759f0a48498c8d49e7a6724cd2451 Mon Sep 17 00:00:00 2001 From: nabinhait Date: Tue, 29 Jul 2014 18:06:18 +0530 Subject: [PATCH] Post gl entries only if there are atleast 2 distinct account head --- erpnext/accounts/general_ledger.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index 673149577d6..a98d6d08f2f 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -15,8 +15,10 @@ def make_gl_entries(gl_map, cancel=False, adv_adj=False, merge_entries=True, if gl_map: if not cancel: gl_map = process_gl_map(gl_map, merge_entries) - if gl_map: + if gl_map and len(gl_map) > 1: save_entries(gl_map, adv_adj, update_outstanding) + else: + frappe.throw(_("No general ledger entries. You might have selected wrong account head")) else: delete_gl_entries(gl_map, adv_adj=adv_adj, update_outstanding=update_outstanding)