From 9543b7d4afca27c4e7f618d3f65b3e4fe6541c52 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Fri, 27 Dec 2019 14:48:46 +0530 Subject: [PATCH] fix: remove status field --- .../doctype/communication/communication.json | 3 +-- frappe/database/mariadb/framework_mariadb.sql | 1 - frappe/database/postgres/framework_postgres.sql | 1 - frappe/desk/doctype/event/event.json | 3 +-- frappe/desk/doctype/todo/todo.json | 3 +-- .../email/doctype/email_account/email_account.py | 16 ++++++---------- 6 files changed, 9 insertions(+), 18 deletions(-) diff --git a/frappe/core/doctype/communication/communication.json b/frappe/core/doctype/communication/communication.json index 3418fc073b..ae6fb164ec 100644 --- a/frappe/core/doctype/communication/communication.json +++ b/frappe/core/doctype/communication/communication.json @@ -386,7 +386,7 @@ "icon": "fa fa-comment", "idx": 1, "links": [], - "modified": "2019-12-12 13:01:23.716052", + "modified": "2019-12-27 14:44:04.880373", "modified_by": "Administrator", "module": "Core", "name": "Communication", @@ -436,7 +436,6 @@ "sender_field": "sender", "sort_field": "modified", "sort_order": "DESC", - "status_field": "status", "subject_field": "subject", "title_field": "subject", "track_changes": 1, diff --git a/frappe/database/mariadb/framework_mariadb.sql b/frappe/database/mariadb/framework_mariadb.sql index 10e2ef7e7d..bf9e0e33c8 100644 --- a/frappe/database/mariadb/framework_mariadb.sql +++ b/frappe/database/mariadb/framework_mariadb.sql @@ -218,7 +218,6 @@ CREATE TABLE `tabDocType` ( `email_append_to` int(1) NOT NULL DEFAULT 0, `subject_field` varchar(255) DEFAULT NULL, `sender_field` varchar(255) DEFAULT NULL, - `status_field` varchar(255) DEFAULT NULL, PRIMARY KEY (`name`), KEY `parent` (`parent`) ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED CHARACTER SET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/frappe/database/postgres/framework_postgres.sql b/frappe/database/postgres/framework_postgres.sql index c89c9a8b16..6bd20d241b 100644 --- a/frappe/database/postgres/framework_postgres.sql +++ b/frappe/database/postgres/framework_postgres.sql @@ -223,7 +223,6 @@ CREATE TABLE "tabDocType" ( `email_append_to` smallint NOT NULL DEFAULT 0, `subject_field` varchar(255) DEFAULT NULL, `sender_field` varchar(255) DEFAULT NULL, - `status_field` varchar(255) DEFAULT NULL, PRIMARY KEY ("name") ) ; diff --git a/frappe/desk/doctype/event/event.json b/frappe/desk/doctype/event/event.json index 8a0372b13f..59ba7689db 100644 --- a/frappe/desk/doctype/event/event.json +++ b/frappe/desk/doctype/event/event.json @@ -276,7 +276,7 @@ "icon": "fa fa-calendar", "idx": 1, "links": [], - "modified": "2019-12-12 12:58:36.621861", + "modified": "2019-12-27 14:45:51.332025", "modified_by": "Administrator", "module": "Desk", "name": "Event", @@ -310,7 +310,6 @@ "sender_field": "sender", "sort_field": "modified", "sort_order": "DESC", - "status_field": "status", "subject_field": "subject", "title_field": "subject", "track_changes": 1, diff --git a/frappe/desk/doctype/todo/todo.json b/frappe/desk/doctype/todo/todo.json index f80a785ccd..cb6dc2fc03 100644 --- a/frappe/desk/doctype/todo/todo.json +++ b/frappe/desk/doctype/todo/todo.json @@ -157,7 +157,7 @@ "icon": "fa fa-check", "idx": 2, "links": [], - "modified": "2019-12-12 12:53:17.565139", + "modified": "2019-12-27 14:45:25.161055", "modified_by": "Administrator", "module": "Desk", "name": "ToDo", @@ -191,7 +191,6 @@ "sender_field": "sender", "sort_field": "modified", "sort_order": "DESC", - "status_field": "status", "subject_field": "description", "title_field": "description", "track_changes": 1, diff --git a/frappe/email/doctype/email_account/email_account.py b/frappe/email/doctype/email_account/email_account.py index 0bd4beed0b..74285e2182 100755 --- a/frappe/email/doctype/email_account/email_account.py +++ b/frappe/email/doctype/email_account/email_account.py @@ -637,24 +637,20 @@ class EmailAccount(Document): frappe.throw(_("Automatic Linking can be activated only for one Email Account.")) @frappe.whitelist() -def get_append_to(doctype=None, txt=None, searchfield=None, start=None, page_len=None, filters=None, reset_cache=False): - - if frappe.cache().hget("email_append_to", "email_append_to_doctypes") and not reset_cache: - return frappe.cache().hget("email_append_to", "email_append_to_doctypes") - +def get_append_to(doctype=None, txt=None, searchfield=None, start=None, page_len=None, filters=None): txt = txt if txt else "" email_append_to_list = [] + # Set Email Append To DocTypes via DocType for dt in frappe.get_all("DocType", filters={"istable": 0, "issingle": 0}, fields=["name", "email_append_to"]): if dt.get("email_append_to") and dt.email_append_to: email_append_to_list.append(dt.name) - else: - meta = frappe.get_meta(dt.name) - if meta.get("email_append_to") and meta.email_append_to: - email_append_to_list.append(dt.name) + + # Set Email Append To DocTypes set via Customize Form + for dt in frappe.get_list("Property Setter", filters={"property": "email_append_to", "value": 1}, fields=["doc_type"]): + email_append_to_list.append(dt.doc_type) email_append_to = [[d] for d in set(email_append_to_list) if txt in d] - frappe.cache().hset("email_append_to", "email_append_to_doctypes", email_append_to) return email_append_to