bom with operations activity

This commit is contained in:
Nabin Hait 2015-03-03 14:44:02 +05:30
parent 885e074697
commit 81b8d7597d
2 changed files with 17 additions and 2 deletions

View File

@ -5,6 +5,7 @@
frappe.provide("erpnext.bom");
cur_frm.cscript.refresh = function(doc,dt,dn){
cur_frm.toggle_enable("item", doc.__islocal);
toggle_operations(cur_frm);
if (!doc.__islocal && doc.docstatus<2) {
cur_frm.add_custom_button(__("Update Cost"), cur_frm.cscript.update_cost,
@ -210,6 +211,20 @@ frappe.ui.form.on("BOM Item", "items_remove", function(frm) {
erpnext.bom.calculate_total(frm.doc);
});
var toggle_operations = function(frm) {
frm.toggle_display("operations_section", cint(frm.doc.with_operations) == 1);
}
frappe.ui.form.on("BOM", "with_operations", function(frm) {
if(!cint(frm.doc.with_operations)) {
frm.set_value("operations", []);
}
toggle_operations(frm);
});
cur_frm.cscript.image = function() {
refresh_field("image_view");
}

View File

@ -82,7 +82,7 @@
"permlevel": 0
},
{
"depends_on": "with_operations",
"depends_on": "",
"description": "Specify the operations, operating cost and give a unique Operation no to your operations.",
"fieldname": "operations_section",
"fieldtype": "Section Break",
@ -279,7 +279,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-02-21 10:31:18.889394",
"modified": "2015-03-03 14:22:44.725097",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM",