Merge pull request #28202 from marination/serial-no-popup-with-scanner

fix: Serial Nos not set in the row after scanning in popup
This commit is contained in:
Marica 2021-11-02 20:17:48 +05:30 committed by GitHub
commit 91112c49e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -206,8 +206,10 @@ erpnext.selling.SellingController = class SellingController extends erpnext.Tran
var me = this;
var item = frappe.get_doc(cdt, cdn);
if (item.serial_no && item.qty === item.serial_no.split(`\n`).length) {
return;
// check if serial nos entered are as much as qty in row
if (item.serial_no) {
let serial_nos = item.serial_no.split(`\n`).filter(sn => sn.trim()); // filter out whitespaces
if (item.qty === serial_nos.length) return;
}
if (item.serial_no && !item.batch_no) {