[ux] direct editing in material request
This commit is contained in:
parent
e13c3ad048
commit
35047ac283
@ -3,7 +3,26 @@
|
|||||||
|
|
||||||
{% include 'erpnext/buying/doctype/purchase_common/purchase_common.js' %};
|
{% include 'erpnext/buying/doctype/purchase_common/purchase_common.js' %};
|
||||||
|
|
||||||
|
frappe.ui.form.on('Material Request', {
|
||||||
|
setup: function(frm) {
|
||||||
|
frm.get_field('items').grid.editable_fields = [
|
||||||
|
{fieldname: 'item_code', columns: 4},
|
||||||
|
{fieldname: 'qty', columns: 3},
|
||||||
|
{fieldname: 'uom', columns: 2},
|
||||||
|
{fieldname: 'schedule_date', columns: 2},
|
||||||
|
];
|
||||||
|
|
||||||
|
// formatter for material request item
|
||||||
|
frappe.meta.set_formatter('Material Request Item', 'item_code', frm.doc.name,
|
||||||
|
function(value, df, options, doc) {
|
||||||
|
return repl('<span class="indicator %(color)s">%(name)s</span>', {
|
||||||
|
color: (doc.qty<=doc.ordered_qty) ? "green" : "orange",
|
||||||
|
name: doc.item_code
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
frappe.ui.form.on("Material Request Item", {
|
frappe.ui.form.on("Material Request Item", {
|
||||||
"qty": function(frm, doctype, name) {
|
"qty": function(frm, doctype, name) {
|
||||||
|
@ -15,9 +15,9 @@ from erpnext.controllers.buying_controller import BuyingController
|
|||||||
from erpnext.manufacturing.doctype.production_order.production_order import get_item_details
|
from erpnext.manufacturing.doctype.production_order.production_order import get_item_details
|
||||||
|
|
||||||
|
|
||||||
form_grid_templates = {
|
# form_grid_templates = {
|
||||||
"items": "templates/form_grid/material_request_grid.html"
|
# "items": "templates/form_grid/material_request_grid.html"
|
||||||
}
|
# }
|
||||||
|
|
||||||
class MaterialRequest(BuyingController):
|
class MaterialRequest(BuyingController):
|
||||||
def get_feed(self):
|
def get_feed(self):
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
{% } else { %}
|
{% } else { %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<span class="indicator {%= (doc.qty<=doc.ordered_qty) ? "green" : "orange" %}">{%= doc.item_code %}</strong>
|
<span class="indicator {%= (doc.qty<=doc.ordered_qty) ? "green" : "orange" %}">{%= doc.item_code %}</span>
|
||||||
{% if(doc.item_name != doc.item_code) { %}
|
{% if(doc.item_name != doc.item_code) { %}
|
||||||
<br>{%= doc.item_name %}{% } %}
|
<br>{%= doc.item_name %}{% } %}
|
||||||
<!-- {% if(doc.item_name != doc.description) { %}
|
<!-- {% if(doc.item_name != doc.description) { %}
|
||||||
|
Loading…
Reference in New Issue
Block a user