Utility: reset serial no status and warehouse
This commit is contained in:
parent
5c38488590
commit
b0a8d000b1
@ -198,6 +198,10 @@ def reset_serial_no_status_and_warehouse(serial_nos=[]):
|
||||
for serial_no in serial_nos:
|
||||
try:
|
||||
sr = frappe.get_doc("Serial No", serial_no)
|
||||
last_sle = sr.get_last_sle()
|
||||
if flt(last_sle.actual_qty) > 0:
|
||||
sr.warehouse = last_sle.warehouse
|
||||
|
||||
sr.via_stock_ledger = True
|
||||
sr.save()
|
||||
except:
|
||||
|
Loading…
Reference in New Issue
Block a user