fix: Transit filter for Default Target Warehouse in SE (#31839)
This commit is contained in:
parent
2d04e71412
commit
f1a612245c
@ -583,19 +583,24 @@ frappe.ui.form.on('Stock Entry', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
add_to_transit: function(frm) {
|
add_to_transit: function(frm) {
|
||||||
if(frm.doc.add_to_transit && frm.doc.purpose=='Material Transfer') {
|
if(frm.doc.purpose=='Material Transfer') {
|
||||||
frm.set_value('to_warehouse', '');
|
var filters = {
|
||||||
frm.fields_dict.to_warehouse.get_query = function() {
|
|
||||||
return {
|
|
||||||
filters:{
|
|
||||||
'warehouse_type' : 'Transit',
|
|
||||||
'is_group': 0,
|
'is_group': 0,
|
||||||
'company': frm.doc.company
|
'company': frm.doc.company
|
||||||
}
|
}
|
||||||
};
|
|
||||||
};
|
if(frm.doc.add_to_transit){
|
||||||
|
filters['warehouse_type'] = 'Transit';
|
||||||
|
frm.set_value('to_warehouse', '');
|
||||||
frm.trigger('set_transit_warehouse');
|
frm.trigger('set_transit_warehouse');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
frm.fields_dict.to_warehouse.get_query = function() {
|
||||||
|
return {
|
||||||
|
filters:filters
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
set_transit_warehouse: function(frm) {
|
set_transit_warehouse: function(frm) {
|
||||||
|
Loading…
Reference in New Issue
Block a user