fix: show stock qty in popup (backport #38698) (#38699)

fix: show stock qty in popup (#38698)

(cherry picked from commit b562b4cf99e68108a0d7ba3a90e60ef3d7d01b0f)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot] 2023-12-12 17:04:57 +05:30 committed by GitHub
parent a75081b8c0
commit 6e2cde4a21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,8 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
secondary_action: () => this.edit_full_form(),
});
this.dialog.set_value("qty", this.item.qty).then(() => {
let qty = this.item.stock_qty || this.item.transfer_qty || this.item.qty;
this.dialog.set_value("qty", qty).then(() => {
if (this.item.serial_no) {
this.dialog.set_value("scan_serial_no", this.item.serial_no);
frappe.model.set_value(this.item.doctype, this.item.name, 'serial_no', '');