Merge pull request #9891 from prssanna/in_preview_customize

feat: Add show preview popup to Customize Form
This commit is contained in:
mergify[bot] 2020-04-20 03:58:16 +00:00 committed by GitHub
commit 27e9c5cfa7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 4 deletions

View file

@ -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})]
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

View file

@ -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",

View file

@ -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",

View file

@ -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',

View file

@ -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",