Merge pull request #24481 from marination/stock-entry-indicator
chore: Set Stock Entry Form Indicators in setup
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index bd2fce8..bc1d089 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -5,6 +5,14 @@
frappe.ui.form.on('Stock Entry', {
setup: function(frm) {
+ frm.set_indicator_formatter('item_code', function(doc) {
+ if (!doc.s_warehouse) {
+ return 'blue';
+ } else {
+ return (doc.qty<=doc.actual_qty) ? 'green' : 'orange';
+ }
+ });
+
frm.set_query('work_order', function() {
return {
filters: [
@@ -779,15 +787,6 @@
}
}
- this.frm.set_indicator_formatter('item_code',
- function(doc) {
- if (!doc.s_warehouse) {
- return 'blue';
- } else {
- return (doc.qty<=doc.actual_qty) ? "green" : "orange"
- }
- })
-
this.frm.add_fetch("purchase_order", "supplier", "supplier");
frappe.dynamic_link = { doc: this.frm.doc, fieldname: 'supplier', doctype: 'Supplier' }