mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
Merge pull request #23646 from rohitwaghchaure/set-current-serial-no-in-serial-no-field
fix: serial no field is blank in stock reconciliation
This commit is contained in:
@@ -109,6 +109,10 @@ frappe.ui.form.on("Stock Reconciliation", {
|
|||||||
frappe.model.set_value(cdt, cdn, "current_amount", r.message.rate * r.message.qty);
|
frappe.model.set_value(cdt, cdn, "current_amount", r.message.rate * r.message.qty);
|
||||||
frappe.model.set_value(cdt, cdn, "amount", r.message.rate * r.message.qty);
|
frappe.model.set_value(cdt, cdn, "amount", r.message.rate * r.message.qty);
|
||||||
frappe.model.set_value(cdt, cdn, "current_serial_no", r.message.serial_nos);
|
frappe.model.set_value(cdt, cdn, "current_serial_no", r.message.serial_nos);
|
||||||
|
|
||||||
|
if (frm.doc.purpose == "Stock Reconciliation") {
|
||||||
|
frappe.model.set_value(cdt, cdn, "serial_no", r.message.serial_nos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ class StockReconciliation(StockController):
|
|||||||
|
|
||||||
if item_dict.get("serial_nos"):
|
if item_dict.get("serial_nos"):
|
||||||
item.current_serial_no = item_dict.get("serial_nos")
|
item.current_serial_no = item_dict.get("serial_nos")
|
||||||
|
if self.purpose == "Stock Reconciliation":
|
||||||
|
item.serial_no = item.current_serial_no
|
||||||
|
|
||||||
item.current_qty = item_dict.get("qty")
|
item.current_qty = item_dict.get("qty")
|
||||||
item.current_valuation_rate = item_dict.get("rate")
|
item.current_valuation_rate = item_dict.get("rate")
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ class TestStockReconciliation(unittest.TestCase):
|
|||||||
to_delete_records.append(sr.name)
|
to_delete_records.append(sr.name)
|
||||||
|
|
||||||
sr = create_stock_reconciliation(item_code=serial_item_code,
|
sr = create_stock_reconciliation(item_code=serial_item_code,
|
||||||
warehouse = serial_warehouse, qty=5, rate=300, serial_no = '\n'.join(serial_nos))
|
warehouse = serial_warehouse, qty=5, rate=300)
|
||||||
|
|
||||||
# print(sr.name)
|
# print(sr.name)
|
||||||
serial_nos1 = get_serial_nos(sr.items[0].serial_no)
|
serial_nos1 = get_serial_nos(sr.items[0].serial_no)
|
||||||
|
|||||||
Reference in New Issue
Block a user