From ce4178b1802b1c9425a901e23d944c514fa2d980 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 1 Feb 2013 12:14:45 +0530 Subject: [PATCH] permission reloaded for bom replace tool --- .../bom_replace_tool/bom_replace_tool.txt | 65 ++++++++++--------- patches/february_2013/__init__.py | 0 .../reload_bom_replace_tool_permission.py | 4 ++ patches/february_2013/remove_gl_mapper.py | 5 ++ patches/patch_list.py | 2 + 5 files changed, 44 insertions(+), 32 deletions(-) create mode 100644 patches/february_2013/__init__.py create mode 100644 patches/february_2013/reload_bom_replace_tool_permission.py create mode 100644 patches/february_2013/remove_gl_mapper.py diff --git a/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt b/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt index bb2c56b3f8..a803608994 100644 --- a/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt +++ b/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt @@ -1,75 +1,76 @@ [ { - "owner": "Administrator", - "docstatus": 0, "creation": "2012-12-06 12:10:10", + "docstatus": 0, + "modified": "2013-02-01 12:07:25", "modified_by": "Administrator", - "modified": "2012-12-06 12:32:22" + "owner": "Administrator" }, { - "in_create": 1, - "allow_print": 1, - "module": "Production", - "document_type": "Other", - "description": "Replace a particular BOM in all other BOMs where it is used. It will replace the old BOM link, update cost and regenerate \"BOM Explosion Item\" table as per new BOM", - "read_only": 1, + "allow_copy": 1, "allow_email": 1, - "hide_heading": 1, - "issingle": 1, - "name": "__common__", + "allow_print": 1, + "description": "Replace a particular BOM in all other BOMs where it is used. It will replace the old BOM link, update cost and regenerate \"BOM Explosion Item\" table as per new BOM", "doctype": "DocType", + "document_type": "Other", + "hide_heading": 1, "hide_toolbar": 1, - "allow_copy": 1 + "in_create": 1, + "issingle": 1, + "module": "Manufacturing", + "name": "__common__", + "read_only": 1 }, { + "doctype": "DocField", "name": "__common__", "parent": "BOM Replace Tool", - "doctype": "DocField", + "parentfield": "fields", "parenttype": "DocType", "permlevel": 0, - "parentfield": "fields" + "read_only": 0 }, { - "parent": "BOM Replace Tool", - "read": 1, - "name": "__common__", "create": 1, "doctype": "DocPerm", - "write": 1, + "name": "__common__", + "parent": "BOM Replace Tool", + "parentfield": "permissions", "parenttype": "DocType", - "role": "Administrator", "permlevel": 0, - "parentfield": "permissions" + "read": 1, + "report": 0, + "role": "Manufacturing Manager", + "submit": 0, + "write": 1 }, { - "name": "BOM Replace Tool", - "doctype": "DocType" + "doctype": "DocType", + "name": "BOM Replace Tool" }, { "description": "The BOM which will be replaced", - "colour": "White:FFF", "doctype": "DocField", - "label": "Current BOM", "fieldname": "current_bom", "fieldtype": "Link", - "reqd": 1, - "options": "BOM" + "label": "Current BOM", + "options": "BOM", + "reqd": 1 }, { "description": "The new BOM after replacement", - "colour": "White:FFF", "doctype": "DocField", - "label": "New BOM", "fieldname": "new_bom", "fieldtype": "Link", - "reqd": 1, - "options": "BOM" + "label": "New BOM", + "options": "BOM", + "reqd": 1 }, { "doctype": "DocField", - "label": "Replace", "fieldname": "replace", "fieldtype": "Button", + "label": "Replace", "options": "replace_bom" }, { diff --git a/patches/february_2013/__init__.py b/patches/february_2013/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/patches/february_2013/reload_bom_replace_tool_permission.py b/patches/february_2013/reload_bom_replace_tool_permission.py new file mode 100644 index 0000000000..fca032e4d3 --- /dev/null +++ b/patches/february_2013/reload_bom_replace_tool_permission.py @@ -0,0 +1,4 @@ +def execute(): + import webnotes + webnotes.conn.sql("""delete from `tabDocPerm` where parent = 'BOM Replace Tool'""") + webnotes.reload_doc("manufacturing", "doctype", "bom_replace_tool") \ No newline at end of file diff --git a/patches/february_2013/remove_gl_mapper.py b/patches/february_2013/remove_gl_mapper.py new file mode 100644 index 0000000000..5a7e418df3 --- /dev/null +++ b/patches/february_2013/remove_gl_mapper.py @@ -0,0 +1,5 @@ +def execute(): + import webnotes + from webnotes.model.doc import delete_doc + for mapper in webnotes.conn.sql("""select name from `tabGL Mapper`"""): + delete_doc("GL Mapper", mapper[0]) \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 4d3146c115..95fe806e2d 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -160,4 +160,6 @@ patch_list = [ "patches.january_2013.rebuild_tree", "execute:webnotes.reload_doc('core','doctype','docfield') #2013-01-28", "patches.january_2013.tabsessions_to_myisam", + "patches.february_2013.remove_gl_mapper", + "patches.february_2013.reload_bom_replace_tool_permission", ] \ No newline at end of file