fix: allow negative stock condition for batch item (#36586)

* fix: allow negative stock condition for batch item

* fix: test case
This commit is contained in:
rohitwaghchaure
2023-08-11 13:57:27 +05:30
committed by GitHub
parent 5488785fd8
commit ee04c6d5c5
3 changed files with 65 additions and 18 deletions

View File

@@ -635,7 +635,7 @@ class update_entries_after(object):
def reset_actual_qty_for_stock_reco(self, sle):
doc = frappe.get_cached_doc("Stock Reconciliation", sle.voucher_no)
doc.recalculate_current_qty(sle.voucher_detail_no, sle.creation, sle.actual_qty > 0)
doc.recalculate_current_qty(sle.voucher_detail_no, sle.creation, sle.actual_qty >= 0)
if sle.actual_qty < 0:
sle.actual_qty = (
@@ -643,9 +643,6 @@ class update_entries_after(object):
* -1
)
if abs(sle.actual_qty) == 0.0:
sle.is_cancelled = 1
def validate_negative_stock(self, sle):
"""
validate negative stock for entries current datetime onwards