From cc2083ebd0a079f565f5ad6174dd5b616a1ac067 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 11 Jul 2016 16:12:12 +0530 Subject: [PATCH] [fix] Advance payment adjustment in sales/purchase invoice --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 441760bd9e..f7d2272488 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -332,6 +332,9 @@ class PaymentEntry(AccountsController): self.set("remarks", "\n".join(remarks)) def make_gl_entries(self, cancel=0, adv_adj=0): + if self.payment_type in ("Receive", "Pay") and not self.get("party_account_field"): + self.setup_party_account_field() + gl_entries = [] self.add_party_gl_entries(gl_entries) self.add_bank_gl_entries(gl_entries)