Items should not be used from Sample Retention warehouse (#11905)
This commit is contained in:
parent
d19be49889
commit
3ca00c7143
@ -4,7 +4,6 @@ frappe.provide("erpnext.stock");
|
||||
|
||||
frappe.ui.form.on('Stock Entry', {
|
||||
setup: function(frm) {
|
||||
|
||||
frm.set_query('production_order', function() {
|
||||
return {
|
||||
filters: [
|
||||
@ -15,6 +14,26 @@ frappe.ui.form.on('Stock Entry', {
|
||||
}
|
||||
});
|
||||
|
||||
frappe.db.get_value('Stock Settings', {name: 'Stock Settings'}, 'sample_retention_warehouse', (r) => {
|
||||
if (r.sample_retention_warehouse) {
|
||||
var filters = [
|
||||
["Warehouse", 'company', '=', frm.doc.company],
|
||||
["Warehouse", "is_group", "=",0],
|
||||
['Warehouse', 'name', '!=', r.sample_retention_warehouse]
|
||||
]
|
||||
frm.set_query("from_warehouse", function() {
|
||||
return {
|
||||
filters: filters
|
||||
};
|
||||
});
|
||||
frm.set_query("s_warehouse", "items", function() {
|
||||
return {
|
||||
filters: filters
|
||||
};
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
frm.set_query('batch_no', 'items', function(doc, cdt, cdn) {
|
||||
var item = locals[cdt][cdn];
|
||||
if(!item.item_code) {
|
||||
@ -39,7 +58,6 @@ frappe.ui.form.on('Stock Entry', {
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
if(!frm.doc.docstatus) {
|
||||
frm.add_custom_button(__('Make Material Request'), function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user