do not allow import of more than 100 supplier/customer at a time

This commit is contained in:
Anand Doshi 2012-06-21 18:40:50 +05:30
parent 5c0dd674e9
commit fd402d03de

View file

@ -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()