Merge pull request #24481 from marination/stock-entry-indicator

chore: Set Stock Entry Form Indicators in setup
This commit is contained in:
Marica 2021-01-28 13:00:24 +05:30 committed by GitHub
commit ed6368d782
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,14 @@ frappe.provide("erpnext.accounts.dimensions");
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 @@ 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");
frappe.dynamic_link = { doc: this.frm.doc, fieldname: 'supplier', doctype: 'Supplier' }