[ux] direct editing in material request

This commit is contained in:
Rushabh Mehta 2016-05-18 18:16:36 +05:30
parent e13c3ad048
commit 35047ac283
3 changed files with 23 additions and 4 deletions

View File

@ -3,7 +3,26 @@
{% 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", {
"qty": function(frm, doctype, name) {

View File

@ -15,9 +15,9 @@ from erpnext.controllers.buying_controller import BuyingController
from erpnext.manufacturing.doctype.production_order.production_order import get_item_details
form_grid_templates = {
"items": "templates/form_grid/material_request_grid.html"
}
# form_grid_templates = {
# "items": "templates/form_grid/material_request_grid.html"
# }
class MaterialRequest(BuyingController):
def get_feed(self):

View File

@ -11,7 +11,7 @@
{% } else { %}
<div class="row">
<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) { %}
<br>{%= doc.item_name %}{% } %}
<!-- {% if(doc.item_name != doc.description) { %}