From fd402d03de2bba90e7136dc3ec720e6bee99a2d4 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 21 Jun 2012 18:40:50 +0530 Subject: [PATCH] do not allow import of more than 100 supplier/customer at a time --- py/core/page/data_import_tool/data_import_tool.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/py/core/page/data_import_tool/data_import_tool.py b/py/core/page/data_import_tool/data_import_tool.py index 99665c9efb..b0f2513428 100644 --- a/py/core/page/data_import_tool/data_import_tool.py +++ b/py/core/page/data_import_tool/data_import_tool.py @@ -153,7 +153,11 @@ def upload(): # doctype doctype = rows[0][0].split(':')[1].strip() doctype_dl = webnotes.model.doctype.get(doctype, form=0) - + + if doctype in ['Customer', 'Supplier'] and len(rows[8:]) > 100: + webnotes.msgprint("Please upload only upto 100 %ss at a time" % doctype) + raise Exception + parenttype, parentfield = None, None if len(rows[1]) > 0 and ':' in rows[1][0]: parenttype = rows[1][0].split(':')[1].strip()