From 63cd3168b22e30747bdba12fefb5cc5bdbdce2c3 Mon Sep 17 00:00:00 2001 From: Kanchan Chauhan Date: Wed, 22 Jun 2016 11:33:15 +0530 Subject: [PATCH] Option to include or not include document link in email body --- frappe/core/doctype/communication/email.py | 4 +- .../print_settings/print_settings.json | 61 ++++++++++++++++++- 2 files changed, 62 insertions(+), 3 deletions(-) diff --git a/frappe/core/doctype/communication/email.py b/frappe/core/doctype/communication/email.py index 83773e62ec..3edb4858f7 100755 --- a/frappe/core/doctype/communication/email.py +++ b/frappe/core/doctype/communication/email.py @@ -191,8 +191,10 @@ def prepare_to_notify(doc, print_html=None, print_format=None, attachments=None) :param print_html: Send given value as HTML attachment. :param print_format: Attach print format of parent document.""" + + view_link = frappe.utils.cint(frappe.db.get_value("Print Settings", "Print Settings", "attach_view_link")) - if print_format: + if print_format and view_link: doc.content += get_attach_link(doc, print_format) set_incoming_outgoing_accounts(doc) diff --git a/frappe/print/doctype/print_settings/print_settings.json b/frappe/print/doctype/print_settings/print_settings.json index 2b178190d5..0307f917d6 100644 --- a/frappe/print/doctype/print_settings/print_settings.json +++ b/frappe/print/doctype/print_settings/print_settings.json @@ -2,6 +2,7 @@ "allow_copy": 0, "allow_import": 0, "allow_rename": 0, + "beta": 0, "creation": "2014-07-17 06:54:20.782907", "custom": 0, "docstatus": 0, @@ -134,6 +135,57 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "view_link_in_email", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "default": "1", + "description": "Check if you want to send document link in email body.", + "fieldname": "attach_view_link", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Attach View Link", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -390,13 +442,14 @@ "hide_toolbar": 0, "icon": "icon-cog", "idx": 0, + "image_view": 0, "in_create": 0, "in_dialog": 0, "is_submittable": 0, "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2016-03-23 03:13:32.357165", + "modified": "2016-06-22 11:31:14.313295", "modified_by": "Administrator", "module": "Print", "name": "Print Settings", @@ -417,6 +470,8 @@ "print": 0, "read": 1, "report": 0, + "restrict": 0, + "restricted": 0, "role": "System Manager", "set_user_permissions": 0, "share": 1, @@ -424,8 +479,10 @@ "write": 1 } ], + "quick_entry": 1, "read_only": 0, "read_only_onload": 0, "sort_field": "modified", - "sort_order": "DESC" + "sort_order": "DESC", + "track_seen": 0 } \ No newline at end of file