[fix] Ignore making SLE for opening stock reco with zero qty

This commit is contained in:
Nabin Hait 2015-07-28 11:14:01 +05:30
parent 8e8e9c61ca
commit c80059e10e

View File

@ -163,16 +163,17 @@ class StockReconciliation(StockController):
}) })
if previous_sle: if previous_sle:
if row.qty in ("", None): if row.qty in ("", None):
row.qty = previous_sle.get("qty_after_transaction") row.qty = previous_sle.get("qty_after_transaction", 0)
if row.valuation_rate in ("", None): if row.valuation_rate in ("", None):
row.valuation_rate = previous_sle.get("valuation_rate") row.valuation_rate = previous_sle.get("valuation_rate", 0)
if row.qty and not row.valuation_rate: if row.qty and not row.valuation_rate:
frappe.throw(_("Valuation Rate required for Item {0}").format(row.item_code)) frappe.throw(_("Valuation Rate required for Item {0}").format(row.item_code))
if previous_sle and row.qty == previous_sle.get("qty_after_transaction") \ if ((previous_sle and row.qty == previous_sle.get("qty_after_transaction")
and row.valuation_rate == previous_sle.get("valuation_rate"): and row.valuation_rate == previous_sle.get("valuation_rate"))
or (not previous_sle and not row.qty)):
continue continue
self.insert_entries(row) self.insert_entries(row)