fix: Transit filter for Default Target Warehouse in SE (#31839)

This commit is contained in:
Sagar Sharma 2022-08-17 16:44:12 +05:30 committed by GitHub
parent 2d04e71412
commit f1a612245c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -583,18 +583,23 @@ frappe.ui.form.on('Stock Entry', {
},
add_to_transit: function(frm) {
if(frm.doc.add_to_transit && frm.doc.purpose=='Material Transfer') {
frm.set_value('to_warehouse', '');
if(frm.doc.purpose=='Material Transfer') {
var filters = {
'is_group': 0,
'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.fields_dict.to_warehouse.get_query = function() {
return {
filters:{
'warehouse_type' : 'Transit',
'is_group': 0,
'company': frm.doc.company
}
filters:filters
};
};
frm.trigger('set_transit_warehouse');
}
},