Merge branch 'production' of github.com:webnotes/erpnext into production

This commit is contained in:
Anand Doshi 2012-12-11 15:22:40 +05:30
commit 038d7aae9b
3 changed files with 18 additions and 17 deletions

View File

@ -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",

View File

@ -31,8 +31,7 @@ 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):

View File

@ -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,7 +15,9 @@ def rename_module():
webnotes.reload_doc("core", "doctype", "page")
webnotes.reload_doc("core", "doctype", "module_def")
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"):
@ -22,9 +25,13 @@ def rename_module():
else:
webnotes.rename_doc("Page", "production-home", "manufacturing-home")
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"))
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()