chore: Set Stock Entry Form Indicators in setup
- Makes it easier to override via customisations - Style consistency with other forms that set indicator in setup as well
This commit is contained in:
parent
907e2990d0
commit
bc370b3ee5
@ -5,6 +5,14 @@ frappe.provide("erpnext.accounts.dimensions");
|
|||||||
|
|
||||||
frappe.ui.form.on('Stock Entry', {
|
frappe.ui.form.on('Stock Entry', {
|
||||||
setup: function(frm) {
|
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() {
|
frm.set_query('work_order', function() {
|
||||||
return {
|
return {
|
||||||
filters: [
|
filters: [
|
||||||
@ -779,15 +787,6 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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");
|
this.frm.add_fetch("purchase_order", "supplier", "supplier");
|
||||||
|
|
||||||
frappe.dynamic_link = { doc: this.frm.doc, fieldname: 'supplier', doctype: 'Supplier' }
|
frappe.dynamic_link = { doc: this.frm.doc, fieldname: 'supplier', doctype: 'Supplier' }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user