diff --git a/frappe/core/doctype/has_role/has_role.py b/frappe/core/doctype/has_role/has_role.py index 3df47393e1..44c27098d9 100644 --- a/frappe/core/doctype/has_role/has_role.py +++ b/frappe/core/doctype/has_role/has_role.py @@ -9,5 +9,5 @@ from frappe.model.document import Document class HasRole(Document): def validate(self): if cint(self.get("__islocal")) and frappe.db.exists("Has Role", { - "parent": self.parent, "role": self.role, "parenttype": "User"}): + "parent": self.parent, "role": self.role}): frappe.throw(frappe._("User '{0}' already has the role '{1}'").format(self.parent, self.role)) diff --git a/frappe/core/doctype/user/user.json b/frappe/core/doctype/user/user.json index 21be24eca5..ed638bd69b 100644 --- a/frappe/core/doctype/user/user.json +++ b/frappe/core/doctype/user/user.json @@ -1,4 +1,5 @@ { + "_liked_by": "[]", "allow_copy": 0, "allow_import": 1, "allow_rename": 1, @@ -1126,35 +1127,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "user_roles", - "fieldtype": "Table", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Roles Assigned", - "length": 0, - "no_copy": 0, - "options": "UserRole", - "permlevel": 1, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_on_submit": 0, "bold": 0, @@ -1906,7 +1878,7 @@ "istable": 0, "max_attachments": 5, "menu_index": 0, - "modified": "2017-02-20 14:00:13.687719", + "modified": "2017-02-22 16:47:32.546965", "modified_by": "Administrator", "module": "Core", "name": "User", diff --git a/frappe/core/doctype/userrole/README.md b/frappe/core/doctype/userrole/README.md deleted file mode 100644 index 2c2c8facc1..0000000000 --- a/frappe/core/doctype/userrole/README.md +++ /dev/null @@ -1 +0,0 @@ -Role belonging to parent User \ No newline at end of file diff --git a/frappe/core/doctype/userrole/__init__.py b/frappe/core/doctype/userrole/__init__.py deleted file mode 100644 index 4dbcd0d163..0000000000 --- a/frappe/core/doctype/userrole/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors -# MIT License. See license.txt - -from __future__ import unicode_literals diff --git a/frappe/core/doctype/userrole/userrole.json b/frappe/core/doctype/userrole/userrole.json deleted file mode 100644 index 4f9b5e3b2a..0000000000 --- a/frappe/core/doctype/userrole/userrole.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "allow_copy": 0, - "allow_import": 0, - "allow_rename": 0, - "autoname": "hash", - "beta": 0, - "creation": "2013-02-06 11:30:13", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "editable_grid": 1, - "fields": [ - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "role", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Role", - "length": 0, - "no_copy": 0, - "oldfieldname": "role", - "oldfieldtype": "Link", - "options": "Role", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": "200px", - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0, - "width": "200px" - } - ], - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 1, - "image_view": 0, - "in_create": 0, - "in_dialog": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 1, - "max_attachments": 0, - "modified": "2016-07-11 03:28:09.690931", - "modified_by": "Administrator", - "module": "Core", - "name": "UserRole", - "owner": "Administrator", - "permissions": [], - "quick_entry": 0, - "read_only": 0, - "read_only_onload": 0, - "track_seen": 0 -} \ No newline at end of file diff --git a/frappe/core/doctype/userrole/userrole.py b/frappe/core/doctype/userrole/userrole.py deleted file mode 100644 index 47625524fd..0000000000 --- a/frappe/core/doctype/userrole/userrole.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors -# MIT License. See license.txt - -from __future__ import unicode_literals -import frappe -from frappe.utils import cint - -from frappe.model.document import Document - -class UserRole(Document): - def validate(self): - if cint(self.get("__islocal")) and frappe.db.exists("UserRole", { - "parent": self.parent, "role": self.role}): - frappe.throw(frappe._("User '{0}' already has the role '{1}'").format(self.parent, self.role)) diff --git a/frappe/patches.txt b/frappe/patches.txt index 6666c1d360..d54b0f00fa 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -7,6 +7,7 @@ frappe.patches.v7_3.rename_page_role_to_has_role frappe.patches.v7_3.set_ref_doctype_roles_to_report frappe.patches.v7_3.copy_user_roles_to_has_roles frappe.patches.v7_3.set_user_permission_for_page_and_report +frappe.patches.v7_3.remove_doctypes frappe.patches.v6_1.rename_file_data frappe.patches.v7_0.re_route #2016-06-27 frappe.patches.v7_2.remove_in_filter diff --git a/frappe/patches/v7_3/remove_doctypes.py b/frappe/patches/v7_3/remove_doctypes.py new file mode 100644 index 0000000000..e6069a8037 --- /dev/null +++ b/frappe/patches/v7_3/remove_doctypes.py @@ -0,0 +1,10 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + for doctype in ['UserRole', 'Event Role']: + if frappe.db.exists('DocType', doctype): + frappe.delete_doc('DocType', doctype) \ No newline at end of file