From 785fe9abc4337fd6f0020f2fe84c07bab90e762d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 18 Jun 2012 12:43:25 +0530 Subject: [PATCH] validation changed in supplier --- erpnext/buying/doctype/supplier/supplier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py index 524e03d78e..67a2aae44f 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -108,7 +108,7 @@ class DocType: msgprint("Supplier Type is mandatory") raise Exception - if not sql("select name from tabAccount where name=%s", (self.doc.supplier_type + " - " + abbr)): + if not sql("select name from tabAccount where name=%s and debit_or_credit = 'Credit' and ifnull(is_pl_account, 'No') = 'No'", (self.doc.supplier_type + " - " + abbr)): # if not group created , create it self.add_account(self.doc.supplier_type, self.get_payables_group(), abbr)