* prevent premature escape when item has serial no and batch no * fetch actual_batch_qty for item * add available_qty to dialog * remove expired batches from drop-down * Update queries.py
This commit is contained in:
@@ -98,11 +98,14 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
||||
let d = this.item;
|
||||
if (d.has_serial_no && d.serial_no) {
|
||||
this.dialog.set_value('serial_no', d.serial_no);
|
||||
} else if (d.batch_no) {
|
||||
}
|
||||
|
||||
if (d.batch_no) {
|
||||
this.dialog.fields_dict.batches.df.data.push({
|
||||
'batch_no': d.batch_no,
|
||||
'actual_qty': d.actual_qty,
|
||||
'selected_qty': d.qty
|
||||
'selected_qty': d.qty,
|
||||
'available_qty': d.actual_batch_qty
|
||||
});
|
||||
|
||||
this.dialog.fields_dict.batches.grid.refresh();
|
||||
@@ -204,7 +207,10 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
||||
label: __('Select Batch'),
|
||||
in_list_view:1,
|
||||
get_query: function() {
|
||||
return {filters: {item: me.item_code }};
|
||||
return {
|
||||
filters: {item: me.item_code },
|
||||
query: 'erpnext.controllers.queries.get_batch_numbers'
|
||||
};
|
||||
},
|
||||
onchange: function(e) {
|
||||
let val = this.get_value();
|
||||
|
||||
Reference in New Issue
Block a user