diff --git a/manufacturing/doctype/bom/bom.txt b/manufacturing/doctype/bom/bom.txt index a2495d5931f..90bcfc71b9d 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, @@ -177,12 +177,6 @@ "fieldtype": "Float", "permlevel": 1 }, - { - "doctype": "DocField", - "fieldname": "col_break24", - "fieldtype": "Column Break", - "permlevel": 0 - }, { "doctype": "DocField", "label": "Total Cost", @@ -222,6 +216,7 @@ "doctype": "DocField", "label": "Item Description", "oldfieldname": "description", + "width": "300px", "fieldname": "description", "fieldtype": "Small Text", "permlevel": 0 @@ -275,7 +270,7 @@ { "print_hide": 0, "doctype": "DocField", - "label": "BOM Explosion Items", + "label": "Exploded BOM Items", "options": "Simple", "fieldname": "section_break0", "fieldtype": "Section Break", @@ -288,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 d9d9598424c..96e12d97203 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 @@ class DocType: 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 8e226bdfd48..0c25b895ae9 100644 --- a/patches/december_2012/production_cleanup.py +++ b/patches/december_2012/production_cleanup.py @@ -3,6 +3,7 @@ import webnotes def execute(): delete_doctypes() rename_module() + rebuilt_exploded_bom() def delete_doctypes(): from webnotes.model import delete_doc @@ -14,17 +15,23 @@ def rename_module(): webnotes.reload_doc("core", "doctype", "page") webnotes.reload_doc("core", "doctype", "module_def") - webnotes.rename_doc("Role", "Production User", "Manufacturing User") - webnotes.rename_doc("Role", "Production Manager", "Manufacturing Manager") + if webnotes.conn.exists("Role", "Production User"): + webnotes.rename_doc("Role", "Production User", "Manufacturing User") + if webnotes.conn.exists("Role", "Production Manager"): + webnotes.rename_doc("Role", "Production Manager", "Manufacturing Manager") if webnotes.conn.exists("Page", "manufacturing-home"): webnotes.delete_doc("Page", "production-home") else: webnotes.rename_doc("Page", "production-home", "manufacturing-home") - webnotes.rename_doc("Module Def", "Production", "Manufacturing") + if webnotes.conn.exists("Module Def", "Production"): + webnotes.rename_doc("Module Def", "Production", "Manufacturing") 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()