mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-02 04:58:29 +00:00
fix(stock): Update batch quantity whenever stock in it is moved
This commit is contained in:
@@ -38,6 +38,11 @@ class StockLedgerEntry(Document):
|
||||
self.check_stock_frozen_date()
|
||||
self.actual_amt_check()
|
||||
|
||||
if self.batch_no:
|
||||
batch = frappe.get_doc("Batch", self.batch_no)
|
||||
batch.calculate_batch_qty()
|
||||
batch.save()
|
||||
|
||||
if not self.get("via_landed_cost_voucher"):
|
||||
from erpnext.stock.doctype.serial_no.serial_no import process_serial_no
|
||||
process_serial_no(self)
|
||||
@@ -139,4 +144,3 @@ def on_doctype_update():
|
||||
|
||||
frappe.db.add_index("Stock Ledger Entry", ["voucher_no", "voucher_type"])
|
||||
frappe.db.add_index("Stock Ledger Entry", ["batch_no", "item_code", "warehouse"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user