Merge branch 'master' of github.com:webnotes/erpnext
diff --git a/stock/doctype/stock_reconciliation/stock_reconciliation.py b/stock/doctype/stock_reconciliation/stock_reconciliation.py
index 4ab0acc..9017843 100644
--- a/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -55,7 +55,14 @@
self.validation_messages = []
item_warehouse_combinations = []
- for row_num, row in enumerate(data[data.index(self.head_row)+1:]):
+
+ # validate no of rows
+ rows = data[data.index(self.head_row)+1:]
+ if len(rows) > 100:
+ msgprint(_("""Sorry! We can only allow upto 100 rows for Stock Reconciliation."""),
+ raise_exception=True)
+
+ for row_num, row in enumerate(rows):
# find duplicates
if [row[0], row[1]] in item_warehouse_combinations:
self.validation_messages.append(_get_msg(row_num, "Duplicate entry"))
@@ -249,8 +256,6 @@
""" Delete Stock Ledger Entries related to this Stock Reconciliation
and repost future Stock Ledger Entries"""
- from stock.stock_ledger import update_entries_after
-
existing_entries = webnotes.conn.sql("""select item_code, warehouse
from `tabStock Ledger Entry` where voucher_type='Stock Reconciliation'
and voucher_no=%s""", self.doc.name, as_dict=1)