Skip to content

Commit

Permalink
fix: Transit filter for Default Target Warehouse in SE (#31839)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-aga-r authored Aug 17, 2022
1 parent 2d04e71 commit f1a6122
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions erpnext/stock/doctype/stock_entry/stock_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
},

Expand Down

0 comments on commit f1a6122

Please sign in to comment.