From aa03ea2a56a9a5d513ba35b43629a4cf04861f07 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Mon, 18 Mar 2019 12:36:42 +0530 Subject: [PATCH] disbale pl check for Sales and Purchase Invoice --- erpnext/accounts/doctype/gl_entry/gl_entry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index 810b6f79b51..5c76799e4ea 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -74,7 +74,8 @@ class GLEntry(Document): def check_pl_account(self): if self.is_opening=='Yes' and \ - frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss": + frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss" and \ + self.voucher_type not in ['Purchase Invoice', 'Sales Invoice']: frappe.throw(_("{0} {1}: 'Profit and Loss' type account {2} not allowed in Opening Entry") .format(self.voucher_type, self.voucher_no, self.account))