mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
Post gl entries only if there are atleast 2 distinct account head
This commit is contained in:
@@ -15,8 +15,10 @@ def make_gl_entries(gl_map, cancel=False, adv_adj=False, merge_entries=True,
|
|||||||
if gl_map:
|
if gl_map:
|
||||||
if not cancel:
|
if not cancel:
|
||||||
gl_map = process_gl_map(gl_map, merge_entries)
|
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)
|
save_entries(gl_map, adv_adj, update_outstanding)
|
||||||
|
else:
|
||||||
|
frappe.throw(_("No general ledger entries. You might have selected wrong account head"))
|
||||||
else:
|
else:
|
||||||
delete_gl_entries(gl_map, adv_adj=adv_adj, update_outstanding=update_outstanding)
|
delete_gl_entries(gl_map, adv_adj=adv_adj, update_outstanding=update_outstanding)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user