diff --git a/frappe/boot.py b/frappe/boot.py index e6d1199b19..eed434f870 100644 --- a/frappe/boot.py +++ b/frappe/boot.py @@ -268,4 +268,18 @@ def get_success_action(): return frappe.get_all("Success Action", fields=["*"]) def get_link_preview_doctypes(): - return [d.name for d in frappe.db.get_all('DocType', {'show_preview_popup': 1})] \ No newline at end of file + from frappe.utils import cint + + link_preview_doctypes = [d.name for d in frappe.db.get_all('DocType', {'show_preview_popup': 1})] + customizations = frappe.get_all("Property Setter", + fields=['doc_type', 'value'], + filters={'property': 'show_preview_popup'} + ) + + for custom in customizations: + if not cint(custom.value) and custom.doc_type in link_preview_doctypes: + link_preview_doctypes.remove(custom.doc_type) + else: + link_preview_doctypes.append(custom.doc_type) + + return link_preview_doctypes diff --git a/frappe/custom/doctype/custom_field/custom_field.json b/frappe/custom/doctype/custom_field/custom_field.json index b274033f80..394f38b56c 100644 --- a/frappe/custom/doctype/custom_field/custom_field.json +++ b/frappe/custom/doctype/custom_field/custom_field.json @@ -41,6 +41,7 @@ "in_list_view", "in_standard_filter", "in_global_search", + "in_preview", "bold", "report_hide", "search_index", @@ -371,12 +372,18 @@ "fieldname": "allow_in_quick_entry", "fieldtype": "Check", "label": "Allow in Quick Entry" + }, + { + "default": "0", + "fieldname": "in_preview", + "fieldtype": "Check", + "label": "In Preview" } ], "icon": "fa fa-glass", "idx": 1, "links": [], - "modified": "2020-03-16 14:52:43.954709", + "modified": "2020-04-10 11:57:10.392218", "modified_by": "Administrator", "module": "Custom", "name": "Custom Field", diff --git a/frappe/custom/doctype/customize_form/customize_form.json b/frappe/custom/doctype/customize_form/customize_form.json index 51a5c0b85f..cd57aa23fe 100644 --- a/frappe/custom/doctype/customize_form/customize_form.json +++ b/frappe/custom/doctype/customize_form/customize_form.json @@ -20,6 +20,7 @@ "track_views", "allow_auto_repeat", "allow_import", + "show_preview_popup", "image_view", "column_break_5", "title_field", @@ -203,6 +204,12 @@ "depends_on": "doc_type", "fieldname": "section_break_23", "fieldtype": "Section Break" + }, + { + "default": "0", + "fieldname": "show_preview_popup", + "fieldtype": "Check", + "label": "Show Preview Popup" } ], "hide_toolbar": 1, @@ -210,7 +217,7 @@ "idx": 1, "issingle": 1, "links": [], - "modified": "2020-03-27 15:06:35.443861", + "modified": "2020-04-10 12:16:01.320411", "modified_by": "Administrator", "module": "Custom", "name": "Customize Form", diff --git a/frappe/custom/doctype/customize_form/customize_form.py b/frappe/custom/doctype/customize_form/customize_form.py index 7d081953dd..9efa555152 100644 --- a/frappe/custom/doctype/customize_form/customize_form.py +++ b/frappe/custom/doctype/customize_form/customize_form.py @@ -32,6 +32,7 @@ doctype_properties = { 'track_views': 'Check', 'allow_auto_repeat': 'Check', 'allow_import': 'Check', + 'show_preview_popup': 'Check', 'email_append_to': 'Check', 'subject_field': 'Data', 'sender_field': 'Data' @@ -53,6 +54,7 @@ docfield_properties = { 'in_list_view': 'Check', 'in_standard_filter': 'Check', 'in_global_search': 'Check', + 'in_preview': 'Check', 'bold': 'Check', 'hidden': 'Check', 'collapsible': 'Check', diff --git a/frappe/custom/doctype/customize_form_field/customize_form_field.json b/frappe/custom/doctype/customize_form_field/customize_form_field.json index 350d159541..d7887cf8bd 100644 --- a/frappe/custom/doctype/customize_form_field/customize_form_field.json +++ b/frappe/custom/doctype/customize_form_field/customize_form_field.json @@ -16,6 +16,7 @@ "in_list_view", "in_standard_filter", "in_global_search", + "in_preview", "bold", "allow_in_quick_entry", "translatable", @@ -381,12 +382,18 @@ "fieldtype": "Code", "label": "Read Only Depends On", "options": "JS" + }, + { + "default": "0", + "fieldname": "in_preview", + "fieldtype": "Check", + "label": "In Preview" } ], "idx": 1, "istable": 1, "links": [], - "modified": "2020-04-15 02:26:59.673750", + "modified": "2020-04-10 11:58:44.573537", "modified_by": "Administrator", "module": "Custom", "name": "Customize Form Field",