mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 13:09:17 +00:00
bom with operations activity
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
frappe.provide("erpnext.bom");
|
frappe.provide("erpnext.bom");
|
||||||
cur_frm.cscript.refresh = function(doc,dt,dn){
|
cur_frm.cscript.refresh = function(doc,dt,dn){
|
||||||
cur_frm.toggle_enable("item", doc.__islocal);
|
cur_frm.toggle_enable("item", doc.__islocal);
|
||||||
|
toggle_operations(cur_frm);
|
||||||
|
|
||||||
if (!doc.__islocal && doc.docstatus<2) {
|
if (!doc.__islocal && doc.docstatus<2) {
|
||||||
cur_frm.add_custom_button(__("Update Cost"), cur_frm.cscript.update_cost,
|
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);
|
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() {
|
cur_frm.cscript.image = function() {
|
||||||
refresh_field("image_view");
|
refresh_field("image_view");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "with_operations",
|
"depends_on": "",
|
||||||
"description": "Specify the operations, operating cost and give a unique Operation no to your operations.",
|
"description": "Specify the operations, operating cost and give a unique Operation no to your operations.",
|
||||||
"fieldname": "operations_section",
|
"fieldname": "operations_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
@@ -279,7 +279,7 @@
|
|||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"modified": "2015-02-21 10:31:18.889394",
|
"modified": "2015-03-03 14:22:44.725097",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "BOM",
|
"name": "BOM",
|
||||||
|
|||||||
Reference in New Issue
Block a user