rebuilt exploded bom items patch
diff --git a/manufacturing/doctype/bom/bom.txt b/manufacturing/doctype/bom/bom.txt
index e381510..90bcfc7 100644
--- a/manufacturing/doctype/bom/bom.txt
+++ b/manufacturing/doctype/bom/bom.txt
@@ -2,9 +2,9 @@
{
"owner": "Administrator",
"docstatus": 0,
- "creation": "2012-07-03 13:30:03",
+ "creation": "2012-12-10 19:03:43",
"modified_by": "Administrator",
- "modified": "2012-12-10 18:30:00"
+ "modified": "2012-12-11 15:13:42"
},
{
"istable": 0,
@@ -19,7 +19,6 @@
"hide_heading": 0,
"issingle": 0,
"name": "__common__",
- "default_print_format": "Standard",
"allow_rename": 0,
"doctype": "DocType",
"is_submittable": 1,
@@ -180,12 +179,6 @@
},
{
"doctype": "DocField",
- "fieldname": "col_break24",
- "fieldtype": "Column Break",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
"label": "Total Cost",
"fieldname": "total_cost",
"fieldtype": "Float",
@@ -223,6 +216,7 @@
"doctype": "DocField",
"label": "Item Description",
"oldfieldname": "description",
+ "width": "300px",
"fieldname": "description",
"fieldtype": "Small Text",
"permlevel": 0
@@ -276,7 +270,7 @@
{
"print_hide": 0,
"doctype": "DocField",
- "label": "BOM Explosion Items",
+ "label": "Exploded BOM Items",
"options": "Simple",
"fieldname": "section_break0",
"fieldtype": "Section Break",
@@ -289,7 +283,7 @@
"no_copy": 1,
"oldfieldtype": "Table",
"doctype": "DocField",
- "label": "BOM Explosion Item",
+ "label": "Exploded BOM Items",
"oldfieldname": "flat_bom_details",
"default": "No Toolbar",
"fieldname": "flat_bom_details",
diff --git a/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py b/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py
index d9d9598..96e12d9 100644
--- a/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py
+++ b/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py
@@ -31,9 +31,8 @@
bom_list = self.get_parent_boms()
for bom in bom_list:
bom_obj = get_obj("BOM", bom, with_children=1)
- bom_obj.update_cost_by_traversing()
- bom_obj.update_flat_bom_by_traversing()
-
+ bom_obj.on_update()
+
def validate_bom(self):
if cstr(self.doc.current_bom) == cstr(self.doc.new_bom):
msgprint("Current BOM and New BOM can not be same", raise_exception=1)
diff --git a/patches/december_2012/production_cleanup.py b/patches/december_2012/production_cleanup.py
index 6a17dba..e4b363f 100644
--- a/patches/december_2012/production_cleanup.py
+++ b/patches/december_2012/production_cleanup.py
@@ -3,6 +3,7 @@
def execute():
delete_doctypes()
rename_module()
+ rebuilt_exploded_bom()
def delete_doctypes():
from webnotes.model import delete_doc
@@ -20,4 +21,7 @@
webnotes.conn.set_global("modules_list",
webnotes.conn.get_global('modules_list').replace("Production", "Manufacturing"))
-
\ No newline at end of file
+def rebuilt_exploded_bom():
+ from webnotes.model.code import get_obj
+ for bom in webnotes.conn.sql("""select name from `tabBOM` where docstatus < 2"""):
+ get_obj("BOM", bom[0], with_children=1).on_update()
\ No newline at end of file