Merge pull request #24615 from ruchamahabal/packed-item-fixes_v13
fix: Issues with packing items
This commit is contained in:
commit
df4eed4c0d
@ -140,6 +140,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
|||||||
() => me.update_batch_serial_no_items(),
|
() => me.update_batch_serial_no_items(),
|
||||||
() => {
|
() => {
|
||||||
refresh_field("items");
|
refresh_field("items");
|
||||||
|
refresh_field("packed_items");
|
||||||
if (me.callback) {
|
if (me.callback) {
|
||||||
return me.callback(me.item);
|
return me.callback(me.item);
|
||||||
}
|
}
|
||||||
@ -154,7 +155,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
|||||||
if (this.item.serial_no) {
|
if (this.item.serial_no) {
|
||||||
this.dialog.fields_dict.serial_no.set_value(this.item.serial_no);
|
this.dialog.fields_dict.serial_no.set_value(this.item.serial_no);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.has_batch && !this.has_serial_no && d.batch_no) {
|
if (this.has_batch && !this.has_serial_no && d.batch_no) {
|
||||||
this.frm.doc.items.forEach(data => {
|
this.frm.doc.items.forEach(data => {
|
||||||
if(data.item_code == d.item_code) {
|
if(data.item_code == d.item_code) {
|
||||||
@ -231,7 +232,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
|||||||
this.map_row_values(row, batch, 'batch_no',
|
this.map_row_values(row, batch, 'batch_no',
|
||||||
'selected_qty', this.values.warehouse);
|
'selected_qty', this.values.warehouse);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
update_serial_no_item() {
|
update_serial_no_item() {
|
||||||
@ -250,7 +251,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
|||||||
filters: { 'name': ["in", selected_serial_nos]},
|
filters: { 'name': ["in", selected_serial_nos]},
|
||||||
fields: ["batch_no", "name"]
|
fields: ["batch_no", "name"]
|
||||||
}).then((data) => {
|
}).then((data) => {
|
||||||
// data = [{batch_no: 'batch-1', name: "SR-001"},
|
// data = [{batch_no: 'batch-1', name: "SR-001"},
|
||||||
// {batch_no: 'batch-2', name: "SR-003"}, {batch_no: 'batch-2', name: "SR-004"}]
|
// {batch_no: 'batch-2', name: "SR-003"}, {batch_no: 'batch-2', name: "SR-004"}]
|
||||||
const batch_serial_map = data.reduce((acc, d) => {
|
const batch_serial_map = data.reduce((acc, d) => {
|
||||||
if (!acc[d['batch_no']]) acc[d['batch_no']] = [];
|
if (!acc[d['batch_no']]) acc[d['batch_no']] = [];
|
||||||
@ -298,6 +299,8 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
|||||||
} else {
|
} else {
|
||||||
row.warehouse = values.warehouse || warehouse;
|
row.warehouse = values.warehouse || warehouse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.frm.dirty();
|
||||||
},
|
},
|
||||||
|
|
||||||
update_total_qty: function() {
|
update_total_qty: function() {
|
||||||
|
|||||||
@ -514,7 +514,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
|
|||||||
make_delivery_note: function() {
|
make_delivery_note: function() {
|
||||||
frappe.model.open_mapped_doc({
|
frappe.model.open_mapped_doc({
|
||||||
method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note",
|
method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note",
|
||||||
frm: me.frm
|
frm: this.frm
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user