fix: stock reco negative batch (#40533)

This commit is contained in:
rohitwaghchaure
2024-03-19 14:54:17 +05:30
committed by GitHub
parent 5a8004bc58
commit a64c2ecf39
2 changed files with 7 additions and 1 deletions

View File

@@ -832,6 +832,13 @@ class SerialandBatchBundle(Document):
if not self.has_batch_no:
return
if (
self.voucher_type == "Stock Reconciliation"
and self.type_of_transaction == "Outward"
and frappe.db.get_value("Stock Reconciliation Item", self.voucher_detail_no, "qty") > 0
):
return
batches = [d.batch_no for d in self.entries if d.batch_no]
if not batches:
return

View File

@@ -154,7 +154,6 @@ class StockReconciliation(StockController):
{
"current_serial_and_batch_bundle": sn_doc.name,
"current_serial_no": "",
"batch_no": "",
}
)