Skip to content

Commit

Permalink
fix: filter batches based on item and warehouse in Pick List (#21780)
Browse files Browse the repository at this point in the history
Co-authored-by: Marica <maricadsouza221197@gmail.com>
  • Loading branch information
Alchez and marination authored May 25, 2020
1 parent 6ff11de commit e5395c3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions erpnext/stock/doctype/pick_list/pick_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ frappe.ui.form.on('Pick List', {
};
});
frm.set_query('item_code', 'locations', () => {
return erpnext.queries.item({ "is_stock_item": 1 });
});
frm.set_query('batch_no', 'locations', (frm, cdt, cdn) => {
const row = locals[cdt][cdn];
return {
query: 'erpnext.controllers.queries.get_batch_no',
filters: {
is_stock_item: 1
}
item_code: row.item_code,
warehouse: row.warehouse
},
};
});
},
Expand Down

0 comments on commit e5395c3

Please sign in to comment.