fix: update set query for warehouse after changing the company (#22632)

* 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>
This commit is contained in:
Afshan 2020-07-21 19:59:30 +05:30 committed by GitHub
parent 9e5aa282ec
commit 66d4b42df0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() {
frm.set_query("warehouse", "items", function(doc) {
return {
filters: filters
filters: {'company': doc.company}
};
});
frm.set_query("set_warehouse", function(){
frm.set_query("set_warehouse", function(doc){
return {
filters: filters
filters: {'company': doc.company}
};
});
frm.set_query("set_from_warehouse", function(doc){
return {
filters: {'company': doc.company}
};
});
},