From e31db06ce79ea6e63755c6ce5c6de8aba98b4e9f Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 31 Mar 2017 23:01:24 +0530 Subject: [PATCH 1/5] [fix] move user role setting to erpnext --- frappe/geo/address_and_contact.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/frappe/geo/address_and_contact.py b/frappe/geo/address_and_contact.py index 717471dbd1..2cf006ab98 100644 --- a/frappe/geo/address_and_contact.py +++ b/frappe/geo/address_and_contact.py @@ -41,22 +41,6 @@ def load_address_and_contact(doc, key): doc.set_onload('contact_list', contact_list) -def set_default_role(doc, method): - '''Set customer, supplier, student based on email''' - if frappe.flags.setting_role: - return - contact_name = frappe.get_value('Contact', dict(email_id=doc.email)) - if contact_name: - contact = frappe.get_doc('Contact', contact_name) - for link in contact.links: - frappe.flags.setting_role = True - if link.link_doctype=='Customer': - doc.add_roles('Customer') - elif link.link_doctype=='Supplier': - doc.add_roles('Supplier') - elif frappe.get_value('Student', dict(student_email_id=doc.email)): - doc.add_roles('Student') - def has_permission(doc, ptype, user): links = get_permitted_and_not_permitted_links(doc.doctype) if not links.get("not_permitted_links"): @@ -155,7 +139,7 @@ def filter_dynamic_link_doctypes(doctype, txt, searchfield, start, page_len, fil filters.pop("parent") filters.update({ - "dt": ("not in", [doctype[0] for doctype in doctypes]), + "dt": ("not in", [d[0] for d in doctypes]), "dt": ("like", txt), }) From 3f7c514a4887676503654c5f678658ffa28e1268 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sat, 1 Apr 2017 01:57:38 +0530 Subject: [PATCH 2/5] Reload contact to update new module, which is required while reloading communication --- frappe/core/doctype/user/user.js | 2 +- frappe/patches/v7_2/update_communications.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frappe/core/doctype/user/user.js b/frappe/core/doctype/user/user.js index b2cea1876b..be69e45147 100644 --- a/frappe/core/doctype/user/user.js +++ b/frappe/core/doctype/user/user.js @@ -84,7 +84,7 @@ frappe.ui.form.on('User', { } } if (!found){ - frm.add_custom_button("Create User Email", function() { + frm.add_custom_button(__("Create User Email"), function() { frm.events.create_user_email(frm) }) } diff --git a/frappe/patches/v7_2/update_communications.py b/frappe/patches/v7_2/update_communications.py index 930b53cc00..b7a1b962f8 100644 --- a/frappe/patches/v7_2/update_communications.py +++ b/frappe/patches/v7_2/update_communications.py @@ -6,10 +6,12 @@ def execute(): remove Guest None from sender full name setup feedback request trigger's is_manual field """ - + frappe.reload_doc('core', 'doctype', 'dynamic_link') + frappe.reload_doc('email', 'doctype', 'contact') + frappe.reload_doc("core", "doctype", "feedback_request") frappe.reload_doc("core", "doctype", "communication") - + if frappe.db.has_column('Communication', 'feedback'): frappe.db.sql("""update tabCommunication set content=ifnull(feedback, "feedback details not provided") where communication_type="Feedback" and content is NULL""") From b47787ff01f887ef6e4345ea211beebab2555102 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sat, 1 Apr 2017 02:14:34 +0530 Subject: [PATCH 3/5] Update patches.txt --- frappe/patches.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/patches.txt b/frappe/patches.txt index 00f8005194..e530148662 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -15,7 +15,7 @@ frappe.patches.v8_0.drop_in_dialog frappe.patches.v8_0.update_published_in_global_search execute:frappe.reload_doc('core', 'doctype', 'custom_docperm') execute:frappe.reload_doc('core', 'doctype', 'deleted_document') -execute:frappe.reload_doc('core', 'doctype', 'version') #2016-12-28 +execute:frappe.reload_doc('core', 'doctype', 'version') #2017-04-01 frappe.patches.v8_0.rename_page_role_to_has_role #2017-03-16 frappe.patches.v7_2.setup_custom_perms #2017-01-19 frappe.patches.v8_0.set_user_permission_for_page_and_report #2017-03-20 @@ -173,4 +173,4 @@ frappe.patches.v7_2.update_communications frappe.patches.v8_0.deprecate_integration_broker frappe.patches.v8_0.setup_email_inbox #2017-03-29 frappe.patches.v8_0.newsletter_childtable_migrate -execute:frappe.db.sql("delete from `tabDesktop Icon` where module_name='Communication'") \ No newline at end of file +execute:frappe.db.sql("delete from `tabDesktop Icon` where module_name='Communication'") From 08ed87663a351828ecd230aee188173eabe25afb Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sat, 1 Apr 2017 19:01:09 +0530 Subject: [PATCH 4/5] Modified date changed for user json --- frappe/core/doctype/user/user.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/doctype/user/user.json b/frappe/core/doctype/user/user.json index 5ca33e6830..c32339421c 100644 --- a/frappe/core/doctype/user/user.json +++ b/frappe/core/doctype/user/user.json @@ -1878,7 +1878,7 @@ "istable": 0, "max_attachments": 5, "menu_index": 0, - "modified": "2017-03-14 14:38:25.869060", + "modified": "2017-04-01 14:38:25.869060", "modified_by": "Administrator", "module": "Core", "name": "User", From f9aa7932d33a2d7a84f9160a2d2a991c3e209acb Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sat, 1 Apr 2017 19:32:12 +0600 Subject: [PATCH 5/5] bumped to version 8.0.4 --- frappe/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/__init__.py b/frappe/__init__.py index acd6f79992..33eed146be 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -13,7 +13,7 @@ import os, sys, importlib, inspect, json from .exceptions import * from .utils.jinja import get_jenv, get_template, render_template -__version__ = '8.0.3' +__version__ = '8.0.4' __title__ = "Frappe Framework" local = Local()