mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 12:49:10 +00:00
chore(serial_and_batch_bundle): remove update_serial_or_batch method (#55481)
This commit is contained in:
@@ -2268,25 +2268,6 @@ def update_serial_batch_no_ledgers(bundle, entries, child_row, parent_doc, wareh
|
|||||||
return doc
|
return doc
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
|
||||||
def update_serial_or_batch(bundle_id: str, serial_no: str | None = None, batch_no: str | None = None):
|
|
||||||
if batch_no and not serial_no:
|
|
||||||
if qty := frappe.db.get_value(
|
|
||||||
"Serial and Batch Entry", {"parent": bundle_id, "batch_no": batch_no}, "qty"
|
|
||||||
):
|
|
||||||
frappe.db.set_value(
|
|
||||||
"Serial and Batch Entry", {"parent": bundle_id, "batch_no": batch_no}, "qty", qty + 1
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
doc = frappe.get_cached_doc("Serial and Batch Bundle", bundle_id)
|
|
||||||
if not serial_no and not batch_no:
|
|
||||||
return
|
|
||||||
|
|
||||||
doc.append("entries", {"serial_no": serial_no, "batch_no": batch_no, "qty": 1})
|
|
||||||
doc.save(ignore_permissions=True)
|
|
||||||
|
|
||||||
|
|
||||||
def get_serial_and_batch_ledger(**kwargs):
|
def get_serial_and_batch_ledger(**kwargs):
|
||||||
kwargs = frappe._dict(kwargs)
|
kwargs = frappe._dict(kwargs)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user