Merge pull request #25063 from ankush/mr_stopped_validation
fix: do not fetch stopped MR in production plan
This commit is contained in:
commit
7d3eda47b4
@ -25,6 +25,16 @@ frappe.ui.form.on('Production Plan', {
|
||||
}
|
||||
});
|
||||
|
||||
frm.set_query('material_request', 'material_requests', function() {
|
||||
return {
|
||||
filters: {
|
||||
material_request_type: "Manufacture",
|
||||
docstatus: 1,
|
||||
status: ["!=", "Stopped"],
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.fields_dict['po_items'].grid.get_field('item_code').get_query = function(doc) {
|
||||
return {
|
||||
query: "erpnext.controllers.queries.item_query",
|
||||
@ -370,4 +380,4 @@ cur_frm.fields_dict['sales_orders'].grid.get_field("sales_order").get_query = fu
|
||||
['Sales Order','docstatus', '=' ,1]
|
||||
]
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -70,7 +70,7 @@ class ProductionPlan(Document):
|
||||
from `tabMaterial Request` mr, `tabMaterial Request Item` mr_item
|
||||
where mr_item.parent = mr.name
|
||||
and mr.material_request_type = "Manufacture"
|
||||
and mr.docstatus = 1 and mr.company = %(company)s
|
||||
and mr.docstatus = 1 and mr.status != "Stopped" and mr.company = %(company)s
|
||||
and mr_item.qty > ifnull(mr_item.ordered_qty,0) {0} {1}
|
||||
and (exists (select name from `tabBOM` bom where bom.item=mr_item.item_code
|
||||
and bom.is_active = 1))
|
||||
|
Loading…
x
Reference in New Issue
Block a user