mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-18 09:47:14 +00:00
fix: added set query for filters in MR (#22770)
Co-authored-by: Marica <maricadsouza221197@gmail.com>
This commit is contained in:
@@ -19,6 +19,12 @@ frappe.ui.form.on('Material Request', {
|
||||
frm.set_indicator_formatter('item_code',
|
||||
function(doc) { return (doc.stock_qty<=doc.ordered_qty) ? "green" : "orange"; });
|
||||
|
||||
frm.set_query("from_warehouse", "items", function(doc) {
|
||||
return {
|
||||
filters: {'company': doc.company}
|
||||
};
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
onload: function(frm) {
|
||||
@@ -27,11 +33,24 @@ frappe.ui.form.on('Material Request', {
|
||||
|
||||
// set schedule_date
|
||||
set_schedule_date(frm);
|
||||
frm.fields_dict["items"].grid.get_field("warehouse").get_query = function(doc) {
|
||||
|
||||
frm.set_query("warehouse", "items", function(doc) {
|
||||
return {
|
||||
filters: {'company': doc.company}
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("set_warehouse", function(doc){
|
||||
return {
|
||||
filters: {'company': doc.company}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("set_from_warehouse", function(doc){
|
||||
return {
|
||||
filters: {'company': doc.company}
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
onload_post_render: function(frm) {
|
||||
|
||||
Reference in New Issue
Block a user