mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-21 07:38:29 +00:00
refactor: fetching qty on warehouse trigger
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
(cherry picked from commit e3ab0e7c67)
This commit is contained in:
@@ -374,12 +374,12 @@ frappe.ui.form.on("Pick List Item", {
|
||||
},
|
||||
|
||||
warehouse: (frm, cdt, cdn) => {
|
||||
let row = frappe.get_doc(cdt, cdn);
|
||||
if (row.warehouse) {
|
||||
get_item_details(row.item_code, row.warehouse).then((data) => {
|
||||
frappe.model.set_value(cdt, cdn, "actual_qty", data.actual_qty);
|
||||
});
|
||||
}
|
||||
const row = frappe.get_doc(cdt, cdn);
|
||||
if (!row.item_code || !row.warehouse) return;
|
||||
get_item_details(row.item_code, row.uom, row.warehouse, frm.doc.company).then((data) => {
|
||||
frappe.model.set_value(cdt, cdn, "actual_qty", data.actual_qty);
|
||||
frappe.model.set_value(cdt, cdn, "company_total_stock", data.company_total_stock);
|
||||
});
|
||||
},
|
||||
|
||||
qty: (frm, cdt, cdn) => {
|
||||
|
||||
Reference in New Issue
Block a user