Skip to content

Commit

Permalink
fix: update set query for warehouse after changing the company (#22632)
Browse files Browse the repository at this point in the history
* fix: update set query for warehouse after changing the company

* fix: changed set_query to get_query

* fix: variable filter doesn't get updated once set on load hence removed

Co-authored-by: Marica <maricadsouza221197@gmail.com>
  • Loading branch information
AfshanKhan and marination authored Jul 21, 2020
1 parent 9e5aa28 commit 66d4b42
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions erpnext/stock/doctype/material_request/material_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,21 @@ frappe.ui.form.on('Material Request', {
// set schedule_date
set_schedule_date(frm);

let filters = {'company': frm.doc.company}
frm.set_query("warehouse", "items", function(doc) {
return {
filters: {'company': doc.company}
};
});

frm.set_query("warehouse", "items", function() {
frm.set_query("set_warehouse", function(doc){
return {
filters: filters
filters: {'company': doc.company}
};
});

frm.set_query("set_warehouse", function(){
frm.set_query("set_from_warehouse", function(doc){
return {
filters: filters
filters: {'company': doc.company}
};
});
},
Expand Down

0 comments on commit 66d4b42

Please sign in to comment.