Merge pull request #17834 from deepeshgarg007/serial-no-fix

fix: Serial no filtering issue for delivered items
This commit is contained in:
Nabin Hait
2019-06-03 14:25:17 +05:30
committed by GitHub

View File

@@ -342,13 +342,24 @@ erpnext.SerialNoBatchSelector = Class.extend({
get_serial_no_fields: function() { get_serial_no_fields: function() {
var me = this; var me = this;
this.serial_list = []; this.serial_list = [];
let serial_no_filters = {
item_code: me.item_code,
delivery_document_no: ""
}
if (me.warehouse_details.name) {
serial_no_filters['warehouse'] = me.warehouse_details.name;
}
return [ return [
{fieldtype: 'Section Break', label: __('Serial No')}, {fieldtype: 'Section Break', label: __('Serial No')},
{ {
fieldtype: 'Link', fieldname: 'serial_no_select', options: 'Serial No', fieldtype: 'Link', fieldname: 'serial_no_select', options: 'Serial No',
label: __('Select'), label: __('Select'),
get_query: function() { get_query: function() {
return { filters: {item_code: me.item_code, warehouse: me.warehouse_details.name}}; return {
filters: serial_no_filters
};
}, },
onchange: function(e) { onchange: function(e) {
if(this.in_local_change) return; if(this.in_local_change) return;