Merge pull request #24615 from ruchamahabal/packed-item-fixes_v13

fix: Issues with packing items
This commit is contained in:
Deepesh Garg 2021-02-15 16:44:10 +05:30 committed by GitHub
commit df4eed4c0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -140,6 +140,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
() => me.update_batch_serial_no_items(),
() => {
refresh_field("items");
refresh_field("packed_items");
if (me.callback) {
return me.callback(me.item);
}
@ -154,7 +155,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
if (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) {
this.frm.doc.items.forEach(data => {
if(data.item_code == d.item_code) {
@ -231,7 +232,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
this.map_row_values(row, batch, 'batch_no',
'selected_qty', this.values.warehouse);
});
}
}
},
update_serial_no_item() {
@ -250,7 +251,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
filters: { 'name': ["in", selected_serial_nos]},
fields: ["batch_no", "name"]
}).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"}]
const batch_serial_map = data.reduce((acc, d) => {
if (!acc[d['batch_no']]) acc[d['batch_no']] = [];
@ -298,6 +299,8 @@ erpnext.SerialNoBatchSelector = Class.extend({
} else {
row.warehouse = values.warehouse || warehouse;
}
this.frm.dirty();
},
update_total_qty: function() {

View File

@ -514,7 +514,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
make_delivery_note: function() {
frappe.model.open_mapped_doc({
method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note",
frm: me.frm
frm: this.frm
})
},