From e813684433f9165583e752e3335786e4b2e4cca5 Mon Sep 17 00:00:00 2001 From: Afshan Date: Thu, 17 Sep 2020 12:57:26 +0530 Subject: [PATCH 1/2] fix: warehouse address filtered based on warehouse --- .../stock/doctype/stock_entry/stock_entry.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 9845bc2f70..592ab5d2ed 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -23,6 +23,24 @@ frappe.ui.form.on('Stock Entry', { } }); + frm.set_query('source_warehouse_address', function() { + return { + filters: { + link_doctype: 'Warehouse', + link_name: frm.doc.from_warehouse + } + } + }); + + frm.set_query('target_warehouse_address', function() { + return { + filters: { + link_doctype: 'Warehouse', + link_name: frm.doc.to_warehouse + } + } + }); + frappe.db.get_value('Stock Settings', {name: 'Stock Settings'}, 'sample_retention_warehouse', (r) => { if (r.sample_retention_warehouse) { var filters = [ @@ -81,6 +99,9 @@ frappe.ui.form.on('Stock Entry', { frm.add_fetch("bom_no", "inspection_required", "inspection_required"); }, + + + setup_quality_inspection: function(frm) { if (!frm.doc.inspection_required) { return; From d5710b4d6f014e25358f7cd38e14b91013062f78 Mon Sep 17 00:00:00 2001 From: Afshan Date: Thu, 17 Sep 2020 13:01:47 +0530 Subject: [PATCH 2/2] style: removed extra spaces --- erpnext/stock/doctype/stock_entry/stock_entry.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 592ab5d2ed..1f95447951 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -99,9 +99,6 @@ frappe.ui.form.on('Stock Entry', { frm.add_fetch("bom_no", "inspection_required", "inspection_required"); }, - - - setup_quality_inspection: function(frm) { if (!frm.doc.inspection_required) { return;