Merge branch 'develop' into minor-search-presets

This commit is contained in:
Nabin Hait 2017-02-24 11:28:51 +05:30 committed by GitHub
commit b10d8cfb0b
86 changed files with 2414 additions and 1572 deletions

View file

@ -2,7 +2,7 @@
[![Build Status](https://travis-ci.org/frappe/frappe.png)](https://travis-ci.org/frappe/frappe)
Full-stack web application framework that uses Python and MariaDB on the server side and a tightly integrated client side library. [Built for ERPNext](https://erpnext.com)
Full-stack web application framework that uses Python and MariaDB on the server side and a tightly integrated client side library. Built for [ERPNext](https://erpnext.com)
### Installation

View file

@ -13,7 +13,7 @@ import os, sys, importlib, inspect, json
from .exceptions import *
from .utils.jinja import get_jenv, get_template, render_template
__version__ = '7.2.15'
__version__ = '7.2.19'
__title__ = "Frappe Framework"
local = Local()
@ -1039,7 +1039,7 @@ def respond_as_web_page(title, html, success=None, http_status_code=None,
local.response['context'] = context
def redirect_to_message(title, html, http_status_code=None, context=None):
def redirect_to_message(title, html, http_status_code=None, context=None, indicator=None):
"""Redirects to /message?id=random
Similar to respond_as_web_page, but used to 'redirect' and show message pages like success, failure, etc. with a detailed message
@ -1063,6 +1063,11 @@ def redirect_to_message(title, html, http_status_code=None, context=None):
'message': html
})
if indicator:
message['context'].update({
"indicator_color": indicator
})
cache().set_value("message_id:{0}".format(message_id), message, expires_in_sec=60)
location = '/message?id={0}'.format(message_id)

View file

@ -49,6 +49,7 @@ def _new_site(db_name, site, mariadb_root_username=None, mariadb_root_password=N
make_site_dirs()
installing = None
try:
installing = touch_file(get_site_path('locks', 'installing.lock'))
@ -66,7 +67,7 @@ def _new_site(db_name, site, mariadb_root_username=None, mariadb_root_password=N
print "*** Scheduler is", scheduler_status, "***"
finally:
if os.path.exists(installing):
if installing and os.path.exists(installing):
os.remove(installing)
frappe.destroy()

View file

@ -408,7 +408,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Communication Type",
@ -1379,7 +1379,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-02-14 22:48:12.845649",
"modified": "2017-02-21 04:57:33.141998",
"modified_by": "Administrator",
"module": "Core",
"name": "Communication",

File diff suppressed because it is too large Load diff

View file

@ -1455,7 +1455,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-02-13 12:09:33.488890",
"modified": "2017-02-17 16:41:27.613879",
"modified_by": "Administrator",
"module": "Core",
"name": "DocType",

View file

@ -145,7 +145,7 @@ class DocType(Document):
def scrub_field_names(self):
"""Sluggify fieldnames if not set from Label."""
restricted = ('name','parent','creation','modified','modified_by',
'parentfield','parenttype',"file_list")
'parentfield','parenttype','file_list', 'flags', 'docstatus')
for d in self.get("fields"):
if d.fieldtype:
if (not getattr(d, "fieldname", None)):
@ -225,7 +225,7 @@ class DocType(Document):
if set(global_search_fields_before_update) != set(global_search_fields_after_update):
frappe.enqueue('frappe.utils.global_search.rebuild_for_doctype',
now=frappe.flags.in_test, doctype=self.name)
now=frappe.flags.in_test or frappe.flags.in_install, doctype=self.name)
def run_module_method(self, method):
from frappe.modules import load_doctype_module
@ -526,6 +526,7 @@ def validate_fields(meta):
fieldname_list = [d.fieldname for d in fields]
not_allowed_in_list_view = list(copy.copy(no_value_fields))
not_allowed_in_list_view.append("Attach Image")
if meta.istable:
not_allowed_in_list_view.remove('Button')

View file

@ -21,6 +21,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "File Name",
@ -51,6 +52,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Private",
@ -79,6 +81,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Preview",
@ -107,6 +110,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Preview HTML",
@ -135,6 +139,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -163,6 +168,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Home Folder",
@ -191,6 +197,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Attachments Folder",
@ -219,6 +226,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "File Size",
@ -246,6 +254,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -274,6 +283,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "File URL",
@ -301,6 +311,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Thumbnail URL",
@ -329,6 +340,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Folder",
@ -358,6 +370,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Folder",
@ -387,6 +400,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -414,6 +428,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Attached To DocType",
@ -442,6 +457,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -469,6 +485,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Attached To Name",
@ -496,6 +513,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Content Hash",
@ -523,6 +541,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "lft",
@ -551,6 +570,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "rgt",
@ -579,6 +599,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "old_parent",
@ -609,7 +630,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-12-29 14:40:12.519235",
"modified": "2017-02-17 16:42:36.092962",
"modified_by": "Administrator",
"module": "Core",
"name": "File",
@ -625,7 +646,6 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -646,7 +666,6 @@
"export": 1,
"if_owner": 1,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -661,6 +680,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_order": "ASC",
"title_field": "file_name",
"track_changes": 1,

View file

@ -22,6 +22,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Module Name",
@ -51,6 +52,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "App Name",
@ -79,7 +81,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-12-29 14:40:10.236430",
"modified": "2017-02-17 16:41:14.342061",
"modified_by": "Administrator",
"module": "Core",
"name": "Module Def",
@ -95,7 +97,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -116,7 +117,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@ -131,6 +131,8 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 1,
"sort_order": "ASC",
"track_changes": 1,
"track_seen": 0
}

View file

@ -23,6 +23,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Report Name",
@ -50,6 +51,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Ref DocType",
@ -78,6 +80,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Is Standard",
@ -106,6 +109,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Module",
@ -134,6 +138,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Add Total Row",
@ -161,6 +166,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -187,6 +193,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Report Type",
@ -215,6 +222,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Disabled",
@ -244,6 +252,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Apply User Permissions",
@ -272,6 +281,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Letter Head",
@ -301,6 +311,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -328,6 +339,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Query",
@ -357,6 +369,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Javascript",
@ -385,6 +398,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "JSON",
@ -413,7 +427,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-12-29 14:39:48.337818",
"modified": "2017-02-17 16:41:40.315658",
"modified_by": "Administrator",
"module": "Core",
"name": "Report",
@ -429,7 +443,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -450,7 +463,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -471,7 +483,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -492,7 +503,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -507,6 +517,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,

View file

@ -23,6 +23,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@ -51,6 +52,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Enabled",
@ -81,6 +83,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -108,6 +111,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email",
@ -138,6 +142,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "First Name",
@ -167,6 +172,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Middle Name (Optional)",
@ -196,6 +202,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Last Name",
@ -225,6 +232,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Full Name",
@ -255,6 +263,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Send Welcome Email",
@ -283,6 +292,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Unsubscribed",
@ -310,6 +320,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -339,6 +350,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Username",
@ -368,6 +380,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Language",
@ -397,6 +410,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Timezone",
@ -425,6 +439,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "User Image",
@ -453,6 +468,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "More Information",
@ -480,6 +496,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Gender",
@ -510,6 +527,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Phone",
@ -538,6 +556,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Birth Date",
@ -567,6 +586,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Location",
@ -594,6 +614,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -620,6 +641,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Bio",
@ -647,6 +669,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Mute Sounds",
@ -676,6 +699,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Change Password",
@ -703,6 +727,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Set New Password",
@ -731,6 +756,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Send Password Update Notification",
@ -759,6 +785,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Reset Password Key",
@ -786,6 +813,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Redirect URL",
@ -815,6 +843,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email Settings",
@ -844,6 +873,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Send Notifications for Transactions I Follow",
@ -872,6 +902,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email Signature",
@ -899,6 +930,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email Inbox",
@ -928,6 +960,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "User Emails",
@ -958,6 +991,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Desktop Background",
@ -986,6 +1020,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Background Image",
@ -1014,6 +1049,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Background Style",
@ -1045,6 +1081,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Roles",
@ -1072,6 +1109,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Roles HTML",
@ -1099,6 +1137,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Roles Assigned",
@ -1129,6 +1168,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Modules Access",
@ -1157,6 +1197,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Modules HTML",
@ -1185,6 +1226,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Block Modules",
@ -1215,6 +1257,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Defaults",
@ -1246,6 +1289,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "User Defaults",
@ -1275,6 +1319,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Security Settings",
@ -1304,6 +1349,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Simultaneous Sessions",
@ -1334,6 +1380,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "User Type",
@ -1365,6 +1412,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Login After",
@ -1393,6 +1441,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Login Before",
@ -1421,6 +1470,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Restrict IP",
@ -1448,6 +1498,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -1477,6 +1528,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Last Login",
@ -1506,6 +1558,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Last IP",
@ -1535,6 +1588,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Last Active",
@ -1564,6 +1618,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Last Known Versions",
@ -1593,6 +1648,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Third Party Authentication",
@ -1620,6 +1676,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Facebook Username",
@ -1647,6 +1704,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Facebook User ID",
@ -1674,6 +1732,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Google User ID",
@ -1701,6 +1760,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -1728,6 +1788,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Github User ID",
@ -1755,6 +1816,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Github Username",
@ -1782,6 +1844,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Frappe User ID",
@ -1813,7 +1876,7 @@
"istable": 0,
"max_attachments": 5,
"menu_index": 0,
"modified": "2017-01-13 07:10:40.266109",
"modified": "2017-02-17 16:41:58.700271",
"modified_by": "Administrator",
"module": "Core",
"name": "User",
@ -1829,7 +1892,6 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -1850,7 +1912,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 1,
"print": 0,
"read": 1,
@ -1866,6 +1927,7 @@
"read_only": 0,
"read_only_onload": 0,
"search_fields": "full_name",
"show_name_in_global_search": 1,
"sort_order": "DESC",
"title_field": "full_name",
"track_changes": 1,

View file

@ -183,6 +183,7 @@ frappe.PermissionEngine = Class.extend({
});
$.each(perm_list, function(i, d) {
if(d.parent==="DocType") { return; }
if(!d.permlevel) d.permlevel = 0;
var row = $("<tr>").appendTo(me.table.find("tbody"));
me.add_cell(row, d, "parent");

View file

@ -176,7 +176,7 @@ class CustomizeForm(Document):
.format(df.idx))
continue
elif property == "in_list_view" and df.get(property) \
and df.fieldtype!="Image" and df.fieldtype in no_value_fields:
and df.fieldtype!="Attach Image" and df.fieldtype in no_value_fields:
frappe.msgprint(_("'In List View' not allowed for type {0} in row {1}")
.format(df.fieldtype, df.idx))
continue

View file

@ -52,7 +52,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_global_search": 1,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Subject",
@ -837,7 +837,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-02-09 03:32:53.484696",
"modified": "2017-02-17 17:02:18.749886",
"modified_by": "Administrator",
"module": "Desk",
"name": "Event",

View file

@ -22,6 +22,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Title",
@ -50,6 +51,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Public",
@ -78,6 +80,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Notify users with a popup when they log in",
@ -107,6 +110,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Expire Notification On",
@ -136,6 +140,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Content",
@ -163,6 +168,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Seen By",
@ -191,6 +197,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Seen By Table",
@ -221,7 +228,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-12-29 14:39:46.072073",
"modified": "2017-02-17 17:02:57.067556",
"modified_by": "Administrator",
"module": "Desk",
"name": "Note",
@ -237,7 +244,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -252,6 +258,7 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 1,
"show_name_in_global_search": 0,
"sort_order": "ASC",
"track_changes": 1,
"track_seen": 0

View file

@ -61,6 +61,7 @@ def get_script(report_name):
@frappe.whitelist()
def run(report_name, filters=None, user=None):
report = get_report_doc(report_name)
if not user:
user = frappe.session.user
@ -111,6 +112,40 @@ def run(report_name, filters=None, user=None):
"chart": chart
}
@frappe.whitelist()
def export_query():
"""export from query reports"""
data = frappe._dict(frappe.local.form_dict)
del data["cmd"]
if isinstance(data.get("filters"), basestring):
filters = json.loads(data["filters"])
if isinstance(data.get("report_name"), basestring):
report_name = data["report_name"]
if isinstance(data.get("file_format_type"), basestring):
file_format_type = data["file_format_type"]
if file_format_type == "Excel":
data = run(report_name, filters)
data = frappe._dict(data)
columns = get_columns_dict(data.columns)
content = []
for col in columns.values():
content.append(col["label"])
from frappe.utils.xlsxutils import make_xlsx
xlsx_file = make_xlsx([content] + data.result, "Query Report")
frappe.response['filename'] = report_name + '.xlsx'
frappe.response['filecontent'] = xlsx_file.getvalue()
frappe.response['type'] = 'binary'
def get_report_module_dotted_path(module, report_name):
return frappe.local.module_app[scrub(module)] + "." + scrub(module) \
+ ".report." + scrub(report_name) + "." + scrub(report_name)
@ -166,6 +201,7 @@ def add_total_row(result, columns, meta = None):
result.append(total_row)
return result
def get_filtered_data(ref_doctype, columns, data, user):
result = []
linked_doctypes = get_linked_doctypes(columns, data)
@ -189,6 +225,7 @@ def get_filtered_data(ref_doctype, columns, data, user):
return result
def has_match(row, linked_doctypes, doctype_match_filters, ref_doctype, if_owner, columns_dict, user):
"""Returns True if after evaluating permissions for each linked doctype
- There is an owner match for the ref_doctype
@ -297,6 +334,7 @@ def get_columns_dict(columns):
else:
col_dict["fieldtype"] = col[1]
col_dict["label"] = col[0]
col_dict["fieldname"] = frappe.scrub(col[0])
# dict

View file

@ -91,8 +91,10 @@ def export_query():
form_params["as_list"] = True
doctype = form_params.doctype
add_totals_row = None
file_format_type = form_params["file_format_type"]
del form_params["doctype"]
del form_params["file_format_type"]
if 'add_totals_row' in form_params and form_params['add_totals_row']=='1':
add_totals_row = 1
@ -110,20 +112,32 @@ def export_query():
for i, row in enumerate(ret):
data.append([i+1] + list(row))
# convert to csv
from cStringIO import StringIO
import csv
if file_format_type == "CSV":
f = StringIO()
writer = csv.writer(f)
for r in data:
# encode only unicode type strings and not int, floats etc.
writer.writerow(map(lambda v: isinstance(v, unicode) and v.encode('utf-8') or v, r))
# convert to csv
import csv
from cStringIO import StringIO
f = StringIO()
writer = csv.writer(f)
for r in data:
# encode only unicode type strings and not int, floats etc.
writer.writerow(map(lambda v: isinstance(v, unicode) and v.encode('utf-8') or v, r))
f.seek(0)
frappe.response['result'] = unicode(f.read(), 'utf-8')
frappe.response['type'] = 'csv'
frappe.response['doctype'] = doctype
elif file_format_type == "Excel":
from frappe.utils.xlsxutils import make_xlsx
xlsx_file = make_xlsx(data, doctype)
frappe.response['filename'] = doctype + '.xlsx'
frappe.response['filecontent'] = xlsx_file.getvalue()
frappe.response['type'] = 'binary'
f.seek(0)
frappe.response['result'] = unicode(f.read(), 'utf-8')
frappe.response['type'] = 'csv'
frappe.response['doctype'] = doctype
def append_totals_row(data):
if not data:

View file

@ -63,7 +63,7 @@ def make_tree_args(**kwarg):
kwarg.update({
name_field: kwarg[name_field],
parent_field: kwarg["parent"]
parent_field: kwarg.get("parent") or kwarg.get(parent_field)
})
return frappe._dict(kwarg)

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View file

@ -22,6 +22,7 @@ We should edit `frappe\core\doctype\user\user.js`
You should be seeing a button on user form as shown below,
![add_custom_button_screenshot](/assets/img/app-development/add_custom_button.png)
<img class="screenshot" alt="Custom Button" src="{{docs_base_url}}/assets/img/app-development/add_custom_button.png">
<!-- markdown -->

View file

@ -2,9 +2,9 @@ Frappe provide a group of standard dialogs that are very usefull while coding.
## Alert Dialog
![Alert](/files/show_alert.png)
<img class="screenshot" src="{{docs_base_url}}/assets/img/app-development/show_alert.png">
Is helpfull for show a non-obstrutive message.
Is helpfull for show a non-obstructive message.
This dialog have 2 parameters `txt`that is the message and `seconds` that is the time that the message will be showed for the user, the standard is `3 seconds`.
@ -16,7 +16,7 @@ This dialog have 2 parameters `txt`that is the message and `seconds` that is the
## Prompt Dialog
![Prompt](/files/promp_dialog.png)
<img class="screenshot" src="{{docs_base_url}}/assets/img/app-development/prompt.png">
Is helpful for ask a value for the user
@ -42,7 +42,7 @@ This dialog have 4 parameters, they are:
---
## Confirm Dialog
![Confirm](/files/confirm_dialog.png)
<img class="screenshot" src="{{docs_base_url}}/assets/img/app-development/confirm-dialog.png">
Usefull to get a confirmation from the user before do an action
@ -68,7 +68,7 @@ This dialog have 3 arguments, they are:
## Message Print
![MSGPrint](/files/msgprint_dialog.png)
<img class="screenshot" src="{{docs_base_url}}/assets/img/app-development/msgprint.png">
Is helpfull for show a informational dialog for the user;
@ -91,7 +91,7 @@ This dialog have 2 arguments, they are:
### Custom Dialog
![Class](/files/dialog_constructor.png)
<img class="screenshot" src="{{docs_base_url}}/assets/img/app-development/dialog.png">
Frappé provide too a `Class` that you can extend and build your own custom dialogs

View file

@ -2,11 +2,8 @@ Use Facebook, Google or GitHub authentication to login to Frappe, and your users
The system uses the **Email Address** supplied by these services to **match with an existing user** in Frappe. If no such user is found, **a new user is created** of the default type **Website User**, if Signup is not disabled in Website Settings. Any System Manager can later change the user type from **Website User** to **System User**, so that the user can access the Desktop.
<figure class="text-center">
<img src="/assets/img/social-logins-1.jpg"
alt="Login screen with Social Logins enabled">
<figcaption>Login screen with Social Logins enabled</figcaption>
</figure>
#### Login screen with Social Logins enabled
<img class="screenshot" alt="Login screen with Social Logins enabled" src="{{docs_base_url}}/assets/img/social-logins.png">
To enable these signups, you need to have **Client ID** and **Client Secret** from these authentication services for your Frappe site. The Client ID and Client Secret are to be set in Website > Setup > Social Login Keys. Here are the steps to obtain these credentials.

View file

@ -26,7 +26,8 @@ Go to
> Setup > Integrations > OAuth Provider Settings
<img class="screenshot" src="assets/frappe/img/oauth_provider_settings.png">
<img class="screenshot" src="{{docs_base_url}}/assets/img/oauth_provider_settings.png">
## Add a Client App
@ -34,7 +35,7 @@ As a System Manager go to
> Setup > Integrations > OAuth Client
<img class="screenshot" src="assets/frappe/img/oauth2_client_app.png">
<img class="screenshot" src="{{docs_base_url}}/assets/img/oauth2_client_app.png">
To add a client fill in the following details

View file

@ -40,33 +40,33 @@ Now you will see Frappe icon on the login page. Click on this icon to login with
### Part 1 : on Frappe Identity Provider (IDP)
Login to IDP
<img img class="screenshot" src="/assets/img/00-login-to-idp.png">
<img class="screenshot" src="{{docs_base_url}}/assets/img/00-login-to-idp.png">
Add OAuth Client on IDP
<img img class="screenshot" src="/assets/img/01-add-oauth-client-on-idp.png">
<img class="screenshot" src="{{docs_base_url}}/assets/img/01-add-oauth-client-on-idp.png">
Set Server URL on IDP
<img img class="screenshot" src="/assets/img/02-set-server-url-on-idp.png">
<img class="screenshot" src="{{docs_base_url}}/assets/img/02-set-server-url-on-idp.png">
### Part 2 : on Frappe App Server
Set `Frappe Client ID` and `Frappe Client Secret` on App server (refer the client set on IDP)
<img img class="screenshot" src="/assets/img/03-set-clientid-client-secret-server-on-app-server.png">
<img class="screenshot" src="{{docs_base_url}}/assets/img/03-set-clientid-client-secret-server-on-app-server.png">
**Note**: Frappe Server URL is the main server where identities from your organization are stored.
Login Screen on App Server (login with frappe)
<img img class="screenshot" src="/assets/img/04-login-screen-on-app-server.png">
<img class="screenshot" src="{{docs_base_url}}/assets/img/04-login-screen-on-app-server.png">
### Part 3 : Redirected on IDP
login with user on IDP
<img img class="screenshot" src="/assets/img/05-login-with-user-on-idp.png">
<img class="screenshot" src="{{docs_base_url}}/assets/img/05-login-with-user-on-idp.png">
Confirm Access on IDP
<img img class="screenshot" src="/assets/img/06-confirm-grant-access-on-idp.png">
<img class="screenshot" src="{{docs_base_url}}/assets/img/06-confirm-grant-access-on-idp.png">
### Part 4 : Back on App Server
Logged in on app server with ID from IDP
<img img class="screenshot" src="/assets/img/07-logged-in-as-website-user-with-id-from-idp.png">
<img class="screenshot" src="{{docs_base_url}}/assets/img/07-logged-in-as-website-user-with-id-from-idp.png">

View file

@ -20,7 +20,7 @@ redirect_uri = <redirect uri from OAuth Client>
#### Confirmation Dialog
<img class="screenshot" src="assets/frappe/img/oauth_confirmation_page.png">
<img class="screenshot" src="{{docs_base_url}}/assets/img/oauth_confirmation_page.png">
Click 'Allow' to receive authorization code in redirect uri.

View file

@ -10,4 +10,4 @@ For example for this folder the `index.txt` looks like:
context
building
{next}
{next}

View file

@ -8,7 +8,7 @@ Roles can be assigned to Website Users and they will see menu based on their rol
1. Each Portal Menu Item can have a role associated with it. If that role is set, then only those users having that role can see that menu item
1. Rules can be set for default roles that will be set on default users on hooks
<img class="screenshot" src="assets/frappe/img/portals/portal-settings.png">
<img class="screenshot" alt="Portal Settings" src="{{docs_base_url}}/assets/img/portals/portal-settings.png">
#### Rules for Default Role

View file

@ -1,8 +1,8 @@
# Customizing Web Forms
Web Forms are a powerful way to add forms to your website. Web forms are powerful and scriptable and from Version 7.1+ they also include tables, paging and other utilties
Web Forms are a powerful way to add forms to your website. Web forms are powerful and scriptable and from Version 7.1+ they also include tables, paging and other utilities
<img class="screenshot" src="assets/frappe/img/portals/sample-web-form.png">
<img class="screenshot" alt="Web Form" src="{{docs_base_url}}/assets/img/portals/sample-web-form.png">
### Standard Web Forms

View file

@ -6,7 +6,7 @@ To create a new Query Report:
### 1. Create a new Report
![Query Report](/assets/query-report.png)
<img class="screenshot" alt="Query Report" src="{{docs_base_url}}/assets/img/query-report.png">
1. Set type as "Query Report"
1. Set the reference DocType - Users that have access to the reference DocType will have access to the report
@ -35,7 +35,7 @@ You can define complex queries such as:
### 3. Check the Report
![Query Report](/assets/query-report-out.png)
<img class="screenshot" alt="Query Report" src="{{docs_base_url}}/assets/img/query-report-out.png">
### 4. Advanced (adding filters)

View file

@ -10,7 +10,7 @@ Since these reports give you unrestricted access via Python scripts, they can on
### 1. Create a new Report
![Query Report](/frappe/docs/assets/img/script-report.png)
<img class="screenshot" alt="Script Report" src="{{docs_base_url}}/assets/img/script-report.png">
1. Set Report Type as "Script Report"
1. Set "Is Standard" as "Yes"

View file

@ -58,7 +58,7 @@ Here is how the General Ledger Report is built:
Here is what the report looks like:
![General Ledger](/assets/frappe_io/images/how-to/general-ledger.png)
<img class="screenshot" alt="General Ledger" src="{{docs_base_url}}/assets/img/general-ledger.png">
##### Comments:

View file

@ -20,6 +20,7 @@ class AutoEmailReport(Document):
def validate(self):
self.validate_report_count()
self.validate_emails()
self.validate_report_format()
def validate_emails(self):
'''Cleanup list of emails'''
@ -39,6 +40,13 @@ class AutoEmailReport(Document):
count = frappe.db.sql('select count(*) from `tabAuto Email Report` where user=%s and enabled=1', self.user)[0][0]
if count > max_reports_per_user + (-1 if self.flags.in_insert else 0):
frappe.throw(_('Only {0} emailed reports are allowed per user').format(max_reports_per_user))
def validate_report_format(self):
""" check if user has select correct report format """
valid_report_formats = ["HTML", "XLS", "CSV"]
if self.format not in valid_report_formats:
frappe.throw(_("%s is not a valid report format. Report format should \
one of the following %s"%(frappe.bold(self.format), frappe.bold(", ".join(valid_report_formats)))))
def get_report_content(self):
'''Returns file in for the report in given format'''

View file

@ -81,7 +81,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Last Name",
@ -554,7 +554,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-01-31 00:15:30.298287",
"modified": "2017-02-20 14:54:33.723052",
"modified_by": "Administrator",
"module": "Email",
"name": "Contact",
@ -805,6 +805,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_order": "ASC",
"track_changes": 0,
"track_seen": 0

View file

@ -23,6 +23,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email Id",
@ -52,6 +53,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Login Id is Different",
@ -81,6 +83,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email Address",
@ -110,6 +113,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Password",
@ -138,6 +142,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Awaiting password",
@ -167,6 +172,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email Account Name",
@ -195,6 +201,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@ -223,6 +230,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Domain",
@ -252,6 +260,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Service",
@ -281,6 +290,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@ -311,6 +321,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Enable Incoming",
@ -340,6 +351,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Use IMAP",
@ -371,6 +383,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email Server",
@ -401,6 +414,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Use SSL",
@ -433,6 +447,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Attachment Limit (MB)",
@ -465,6 +480,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Append To",
@ -496,6 +512,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Incoming",
@ -525,6 +542,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -552,6 +570,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Notify if unreplied",
@ -582,6 +601,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Notify if unreplied for (in mins)",
@ -612,6 +632,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Send Notification to",
@ -640,6 +661,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@ -670,6 +692,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Enable Outgoing",
@ -700,6 +723,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "SMTP Server",
@ -730,6 +754,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Use TLS",
@ -761,6 +786,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Port",
@ -792,6 +818,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Default Outgoing",
@ -822,6 +849,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Always use Account's Email Address as Sender",
@ -851,6 +879,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Send unsubscribe message in email",
@ -879,6 +908,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@ -908,6 +938,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Add Signature",
@ -937,6 +968,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Signature",
@ -965,6 +997,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@ -993,6 +1026,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Enable Auto Reply",
@ -1023,6 +1057,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Auto Reply Message",
@ -1051,6 +1086,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@ -1079,6 +1115,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Footer",
@ -1107,6 +1144,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "uid validity",
@ -1135,6 +1173,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "uidnext",
@ -1163,6 +1202,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "No of emails remaining to be synced",
@ -1191,6 +1231,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "no failed attempts",
@ -1220,7 +1261,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-01-06 13:57:39.516766",
"modified": "2017-02-17 17:00:50.782900",
"modified_by": "Administrator",
"module": "Email",
"name": "Email Account",
@ -1237,7 +1278,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@ -1252,6 +1292,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,

View file

@ -22,6 +22,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Title",
@ -51,6 +52,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Total Subscribers",
@ -79,7 +81,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-12-29 14:40:35.253956",
"modified": "2017-02-17 17:01:07.647800",
"modified_by": "Administrator",
"module": "Email",
"name": "Email Group",
@ -96,7 +98,6 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -111,6 +112,7 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,

View file

@ -23,6 +23,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Email Group",
@ -52,6 +53,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Email",
@ -80,6 +82,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Unsubscribed",
@ -108,7 +111,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-12-29 14:40:21.545713",
"modified": "2017-02-17 17:00:42.551806",
"modified_by": "Administrator",
"module": "Email",
"name": "Email Group Member",
@ -125,7 +128,6 @@
"export": 1,
"if_owner": 0,
"import": 1,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -140,6 +142,7 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "email",

View file

@ -24,6 +24,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Email Group",
@ -53,6 +54,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Subject",
@ -81,6 +83,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Sender",
@ -108,6 +111,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email Sent?",
@ -135,6 +139,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Scheduled To Send",
@ -163,6 +168,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@ -190,6 +196,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Message",
@ -218,6 +225,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@ -246,6 +254,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Test Email Address",
@ -273,6 +282,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Test",
@ -303,7 +313,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2017-01-19 06:16:23.102086",
"modified": "2017-02-17 17:01:20.598041",
"modified_by": "Administrator",
"module": "Email",
"name": "Newsletter",
@ -333,6 +343,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_order": "ASC",
"title_field": "subject",
"track_changes": 1,

View file

@ -25,6 +25,7 @@ def load_address_and_contact(doc, key):
doc.set_onload('addr_list', address_list)
contact_list = []
if doc.doctype != "Lead":
filters = [
["Dynamic Link", "link_doctype", "=", doc.doctype],
@ -38,7 +39,7 @@ def load_address_and_contact(doc, key):
(int(a.is_primary_contact - b.is_primary_contact)) or
(1 if a.modified - b.modified else 0), reverse=True)
doc.set_onload('contact_list', contact_list)
doc.set_onload('contact_list', contact_list)
def set_default_role(doc, method):
'''Set customer, supplier, student based on email'''

View file

@ -21,6 +21,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
@ -50,6 +51,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Address Title",
@ -77,6 +79,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Address Type",
@ -105,6 +108,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Address Line 1",
@ -132,6 +136,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Address Line 2",
@ -158,7 +163,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "City/Town",
@ -186,6 +192,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "County",
@ -213,7 +220,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "State",
@ -240,7 +248,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Country",
@ -268,7 +277,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Postal Code",
@ -296,6 +306,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -323,6 +334,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email Address",
@ -350,6 +362,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Phone",
@ -376,7 +389,8 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Fax",
@ -406,6 +420,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Preferred Billing Address",
@ -435,6 +450,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Preferred Shipping Address",
@ -462,6 +478,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Reference",
@ -491,6 +508,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Your Company Address",
@ -519,6 +537,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Links",
@ -549,7 +568,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-01-13 05:01:15.084023",
"modified": "2017-02-17 17:00:32.691465",
"modified_by": "Administrator",
"module": "Geo",
"name": "Address",
@ -565,7 +584,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -586,7 +604,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -607,7 +624,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -628,7 +644,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -644,6 +659,7 @@
"read_only": 0,
"read_only_onload": 0,
"search_fields": "country, state",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 0,

View file

@ -59,7 +59,7 @@ def authorize(*args, **kwargs):
if frappe.session['user']=='Guest':
#Force login, redirect to preauth again.
frappe.local.response["type"] = "redirect"
frappe.local.response["location"] = "/login?redirect-to=/api/method/frappe.integration_broker.oauth2.authorize?" + quote(params)
frappe.local.response["location"] = "/login?redirect-to=/api/method/frappe.integration_broker.oauth2.authorize?" + quote(params.replace("+"," "))
elif frappe.session['user']!='Guest':
try:

View file

@ -20,7 +20,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "LDAP Server Url",
@ -48,7 +47,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Organizational Unit",
@ -76,7 +74,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Base Distinguished Name (DN)",
@ -104,7 +101,6 @@
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Password for Base DN",
@ -121,6 +117,140 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_5",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ldap_search_string",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "LDAP Search String",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ldap_first_name_field",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "LDAP First Name Field",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ldap_email_field",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "LDAP Email Field",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "ldap_username_field",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "LDAP Username Field",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
@ -133,7 +263,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
"modified": "2016-12-29 14:40:32.018140",
"modified": "2017-02-06 15:37:20.481090",
"modified_by": "Administrator",
"module": "Integrations",
"name": "LDAP Settings",
@ -150,7 +280,6 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View file

@ -54,9 +54,13 @@ def get_service_details():
To setup LDAP you need,
<ul>
<li> Server URL & Port : ldap://ldap.forumsys.com:389</li>
<li> Base Distinguished Name : cn=read-only-admin,dc=example,dc=com</li>
<li> Organisational Unit : ou=mathematicians,dc=example,dc=com</li>
<li> Password : Base DN password </li>
<li> Base Distinguished Name : cn=read-only-admin,dc=example,dc=com</li>
<li> Organisational Unit : ou=mathematicians,dc=example,dc=com</li>
<li> Password : Base DN password</li>
<li> LDAP Search Criteria : uid=*{0}</li>
<li> LDAP First Name Fields : cn</li>
<li> LDAP Username Field : ui</li>
<li> LDAP Email Field : mail</li>
</ul>
</li>
<br>
@ -103,7 +107,7 @@ def authenticate_ldap_user(user=None, password=None):
dn = None
params = {}
settings = get_ldap_settings()
try:
import ldap
except:
@ -115,7 +119,7 @@ def authenticate_ldap_user(user=None, password=None):
</div>
"""
frappe.throw(msg, title="LDAP Not Installed")
conn = ldap.initialize(settings.ldap_server_url)
try:
@ -126,16 +130,14 @@ def authenticate_ldap_user(user=None, password=None):
#available options for how deep a search you want.
#LDAP_SCOPE_BASE, LDAP_SCOPE_ONELEVEL,LDAP_SCOPE_SUBTREE,
result = conn.search_s(settings.organizational_unit, ldap.SCOPE_SUBTREE,
"uid=*{0}".format(user))
print result
settings.ldap_search_string.format(user))
for dn, r in result:
dn = cstr(dn)
params["email"] = cstr(r['mail'][0])
params["username"] = cstr(r['uid'][0])
params["first_name"] = cstr(r['cn'][0])
params["email"] = cstr(r[settings.ldap_email_field][0])
params["username"] = cstr(r[settings.ldap_username_field][0])
params["first_name"] = cstr(r[settings.ldap_first_name_field][0])
if dn:
conn.simple_bind_s(dn, password)
return create_user(params)

View file

@ -101,6 +101,7 @@ def sync_customizations_for_doctype(data):
from frappe.core.doctype.doctype.doctype import validate_fields_for_doctype
doctype = data['doctype']
update_schema = False
def sync(key, custom_doctype, doctype_fieldname):
frappe.db.sql('delete from `tab{0}` where `{1}`=%s'.format(custom_doctype, doctype_fieldname),
@ -113,6 +114,7 @@ def sync_customizations_for_doctype(data):
if data['custom_fields']:
sync('custom_fields', 'Custom Field', 'dt')
update_schema = True
if data['property_setters']:
sync('property_setters', 'Property Setter', 'doc_type')
@ -123,6 +125,10 @@ def sync_customizations_for_doctype(data):
print 'Updating customizations for {0}'.format(doctype)
validate_fields_for_doctype(doctype)
if update_schema and not frappe.db.get_value('DocType', doctype, 'issingle'):
from frappe.model.db_schema import updatedb
updatedb(doctype)
def scrub(txt):
return frappe.scrub(txt)

View file

@ -34,6 +34,7 @@ class WebApplicationServer(AuthorizationEndpoint, TokenEndpoint, ResourceEndpoin
:param kwargs: Extra parameters to pass to authorization-,
token-, resource-, and revocation-endpoint constructors.
"""
implicit_grant = ImplicitGrant(request_validator)
auth_grant = AuthorizationCodeGrant(request_validator)
refresh_grant = RefreshTokenGrant(request_validator)
openid_connect_auth = OpenIDConnectAuthCode(request_validator)
@ -48,6 +49,7 @@ class WebApplicationServer(AuthorizationEndpoint, TokenEndpoint, ResourceEndpoin
'code token': openid_connect_auth,
'code id_token': openid_connect_auth,
'code token id_token': openid_connect_auth,
'token': implicit_grant
},
default_token_type=bearer)
TokenEndpoint.__init__(self, default_grant_type='authorization_code',
@ -205,7 +207,7 @@ class OAuthWebRequestValidator(RequestValidator):
otoken.user = request.user
otoken.scopes = get_url_delimiter().join(request.scopes)
otoken.access_token = token['access_token']
otoken.refresh_token = token['refresh_token']
otoken.refresh_token = token.get('refresh_token')
otoken.expires_in = token['expires_in']
otoken.save(ignore_permissions=True)
frappe.db.commit()

View file

@ -0,0 +1,18 @@
import frappe
from frappe.utils import cint
def execute():
frappe.reload_doc("integrations", "doctype", "ldap_settings")
if not frappe.db.exists("Integration Server", "LDAP"):
return
if not cint(frappe.db.get_value("Integration Server", "LDAP", 'enabled')):
return
import ldap
try:
ldap_settings = frappe.get_doc("LDAP Settings")
ldap_settings.save(ignore_permissions=True)
except ldap.LDAPError:
pass

View file

@ -687,8 +687,18 @@ fieldset[disabled] .form-control {
padding: 0px;
overflow-y: auto;
}
.search-dialog .layout-side-section {
padding-left: 15px;
.search-dialog .layout-side-section .help-link {
padding-top: 20px;
text-transform: uppercase;
}
.search-dialog .layout-side-section .nav > li > a {
padding-left: 20px;
}
.search-dialog .results-area a {
color: #5E64FF;
}
.search-dialog .results-area .single-link a {
color: #36414c;
}
.search-dialog .module-section .back-link {
margin-bottom: 20px;
@ -698,11 +708,19 @@ fieldset[disabled] .form-control {
font-family: 'Octicons';
content: '\f0a4';
}
.search-dialog .dual-section .result a {
color: black;
.search-dialog .full-list .result {
border-bottom: 1px solid #d1d8dd;
margin-top: 10px;
}
.search-dialog .dual-section .result a b {
color: #4e6161;
.search-dialog .full-list .result .result-subtype {
float: right;
margin-left: 10px;
}
.search-dialog .full-list .section-head {
margin-bottom: 25px;
}
.search-dialog .dual-section .result-subtype {
display: none;
}
.search-dialog .result-status {
margin-top: 30px;

View file

@ -135,6 +135,11 @@
.navbar-form .awesomplete {
width: 300px;
}
@media (max-width: 1199px) {
.navbar-form .awesomplete {
width: 280px;
}
}
@media (max-width: 991px) {
.navbar-form .awesomplete {
width: 250px;
@ -200,7 +205,7 @@
}
}
.toolbar-user-fullname {
max-width: 200px;
max-width: 150px;
display: inline-block;
}
.navbar-brand {

View file

@ -238,6 +238,9 @@ h6.uppercase,
.timeline-item .btn-more {
margin-left: 65px;
}
.timeline-item .gmail_extra {
display: none;
}
.timeline-items {
position: relative;
}

View file

@ -20,16 +20,21 @@
}
.column-picker-dialog .column-list .column-list-item {
padding: 10px;
cursor: move;
border-bottom: 1px solid #d1d8dd;
}
.column-picker-dialog .column-list .column-list-item:last-child {
border-bottom: none;
}
.column-picker-dialog .column-list .drag-handle {
.column-picker-dialog .column-list .sortable-handle {
cursor: move;
}
.column-picker-dialog .column-list .sortable-chosen {
background-color: #fffce7;
}
.column-picker-dialog .column-list .fa-sort {
margin: 0px 7px;
position: relative;
top: -1px;
margin-top: 9px;
margin-right: -15px;
}
.column-picker-dialog .column-list .form-control {
display: inline-block;

View file

@ -634,8 +634,9 @@ frappe.ui.form.ControlDate = frappe.ui.form.ControlData.extend({
(frappe.boot.sysdefaults.date_format || 'yyyy-mm-dd');
this.datepicker_options.dateFormat = date_format;
this.datepicker_options.onSelect = function(dateObj) {
me.set_value(me.get_value())
this.datepicker_options.onSelect = function(dateStr) {
if(dateStr === me.get_value()) return;
me.set_value(me.get_value());
me.$input.trigger('change')
}
},
@ -1594,6 +1595,7 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['height', ['height']],
['media', ['link', 'picture', 'video', 'table']],
['misc', ['fullscreen', 'codeview']]
],
callbacks: {
@ -1641,7 +1643,7 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
'minus': 'fa fa-minus',
'orderedlist': 'fa fa-list-ol',
'pencil': 'fa fa-pencil',
'picture': 'fa fa-picture',
'picture': 'fa fa-image',
'question': 'fa fa-question',
'redo': 'fa fa-redo',
'square': 'fa fa-square',
@ -1654,7 +1656,7 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
'underline': 'fa fa-underline',
'undo': 'fa fa-undo',
'unorderedlist': 'fa fa-list-ul',
'video': 'fa fa-video'
'video': 'fa fa-video-camera'
}
});
this.note_editor = $(this.input_area).find('.note-editor');

View file

@ -401,8 +401,10 @@ frappe.ui.form.Timeline = Class.extend({
out.push(me.get_version_comment(version, __('cancelled this document')));
}
} else {
var df = frappe.meta.get_docfield(me.frm.doctype, p[0], me.frm.docname);
if(!df.hidden) {
if(df && !df.hidden) {
var field_display_status = frappe.perm.get_field_display_status(df, null,
me.frm.perm);
if(field_display_status === 'Read' || field_display_status === 'Write') {
@ -429,7 +431,7 @@ frappe.ui.form.Timeline = Class.extend({
var df = frappe.meta.get_docfield(me.frm.fields_dict[row[0]].grid.doctype,
p[0], me.frm.docname);
if(!df.hidden) {
if(df && !df.hidden) {
field_display_status = frappe.perm.get_field_display_status(df,
null, me.frm.perm);

View file

@ -59,7 +59,7 @@ frappe.form.formatters = {
if(value) {
return '<i class="octicon octicon-check" style="margin-right: 3px;"></i>';
} else {
return '<i class="fa fa-square-o text-extra-muted" style="margin-right: 3px;"></i>';
return '<i class="fa fa-circle-o text-extra-muted" style="margin-right: 3px; margin-bottom: -2px;"></i>';
}
},
Link: function(value, docfield, options, doc) {

View file

@ -290,7 +290,7 @@ frappe.ui.form.Grid = Class.extend({
new Sortable($rows.get(0), {
group: {name: 'row'},
handle: ".sortable-handle",
handle: '.sortable-handle',
draggable: '.grid-row',
filter: 'li, a',
onUpdate: function(event, ui) {
@ -628,7 +628,7 @@ frappe.ui.form.GridRow = Class.extend({
var me = this;
this.wrapper = $('<div class="grid-row"></div>').appendTo(this.parent).data("grid_row", this);
this.row = $('<div class="data-row row sortable-handle"></div>').appendTo(this.wrapper)
this.row = $('<div class="data-row row"></div>').appendTo(this.wrapper)
.on("click", function(e) {
if($(e.target).hasClass('grid-row-check') || $(e.target).hasClass('row-index') || $(e.target).parent().hasClass('row-index')) {
return;
@ -750,7 +750,7 @@ frappe.ui.form.GridRow = Class.extend({
// index (1, 2, 3 etc)
if(!this.row_index) {
var txt = (this.doc ? this.doc.idx : "&nbsp;");
this.row_index = $('<div class="row-index col col-xs-1">' +
this.row_index = $('<div class="row-index sortable-handle col col-xs-1">' +
this.row_check_html +
' <span>' + txt + '</span></div>')
.appendTo(this.row)
@ -787,7 +787,7 @@ frappe.ui.form.GridRow = Class.extend({
if(!this.open_form_button) {
this.open_form_button = $('<a class="close btn-open-row">\
<span class="octicon octicon-triangle-down"></span></a>')
.appendTo($('<div class="col col-xs-1"></div>').appendTo(this.row))
.appendTo($('<div class="col col-xs-1 sortable-handle"></div>').appendTo(this.row))
.on('click', function() { me.toggle_view(); return false; });
if(this.is_too_small()) {
@ -950,7 +950,7 @@ frappe.ui.form.GridRow = Class.extend({
return;
}
var values = me.get_data();
var values = me.grid.get_data();
var fieldname = $(this).attr('data-fieldname');
var fieldtype = $(this).attr('data-fieldtype');

View file

@ -244,6 +244,7 @@ frappe.ui.form.Toolbar = Class.extend({
}
} else {
this.page.clear_actions();
this.current_status = null
}
},
get_action_status: function() {

View file

@ -8,15 +8,17 @@ $.extend(frappe.geo, {
render_address_and_contact: function(frm) {
// render address
$(frm.fields_dict['address_html'].wrapper)
.html(frappe.render_template("address_list",
cur_frm.doc.__onload))
.find(".btn-address").on("click", function() {
frappe.new_doc("Address");
});
if(frm.fields_dict['address_html'] && "addr_list" in frm.doc.__onload) {
$(frm.fields_dict['address_html'].wrapper)
.html(frappe.render_template("address_list",
cur_frm.doc.__onload))
.find(".btn-address").on("click", function() {
frappe.new_doc("Address");
});
}
// render contact
if(frm.fields_dict['contact_html']) {
if(frm.fields_dict['contact_html'] && "contact_list" in frm.doc.__onload) {
$(frm.fields_dict['contact_html'].wrapper)
.html(frappe.render_template("contact_list",
cur_frm.doc.__onload))

View file

@ -54,12 +54,12 @@ frappe.avatar = function(user, css_class, title) {
frappe.get_palette = function(txt) {
return '#fafbfc';
//return '#8D99A6';
if(txt==='Administrator') return '#36414C';
// get color palette selection from md5 hash
var idx = cint((parseInt(md5(txt).substr(4,2), 16) + 1) / 5.33);
if(idx > 47) idx = 47;
return frappe.palette[idx][0]
// //return '#8D99A6';
// if(txt==='Administrator') return '#36414C';
// // get color palette selection from md5 hash
// var idx = cint((parseInt(md5(txt).substr(4,2), 16) + 1) / 5.33);
// if(idx > 47) idx = 47;
// return frappe.palette[idx][0]
}
frappe.get_abbr = function(txt, max_length) {

View file

@ -12,7 +12,8 @@ function flt(v, decimals, number_format) {
// strip currency symbol if exists
if(v.indexOf(" ")!=-1) {
// using slice(1).join(" ") because space could also be a group separator
v = isNaN(parseFloat(v.split(" ")[0])) ? v.split(" ").slice(1).join(" ") : v;
parts = v.split(" ");
v = isNaN(parseFloat(parts[0])) ? parts.slice(parts.length - 1).join(" ") : v;
}
v = strip_number_groups(v, number_format);

View file

@ -158,12 +158,17 @@ frappe.request.call = function(opts) {
}
})
.always(function(data, textStatus, xhr) {
if(typeof data==="string") {
data = JSON.parse(data);
}
if(data.responseText) {
var xhr = data;
data = JSON.parse(data.responseText);
try {
if(typeof data==="string") {
data = JSON.parse(data);
}
if(data.responseText) {
var xhr = data;
data = JSON.parse(data.responseText);
}
} catch(e) {
data = null;
// pass
}
frappe.request.cleanup(opts, data);
if(opts.always) {

View file

@ -12,17 +12,21 @@ frappe.search.AwesomeBar = Class.extend({
this.nav = new frappe.search.NavSearch();
this.help = new frappe.search.HelpSearch();
this.options = [];
this.global_results = [];
var awesomplete = new Awesomplete(input, {
minChars: 0,
maxItems: 99,
autoFirst: true,
list: [],
filter: function (text, term) {
return true;
filter: function (text, term) {
return true;
},
data: function (item, input) {
var label = item.label + "%%%" + item.value + "%%%" +
(item.description || "") + "%%%" + (item.index || "");
var label = item.label + "%%%" + item.value + "%%%" +
(item.description || "") + "%%%" + (item.index || "")
+ "%%%" + (item.type || "") + "%%%" + (item.prefix || "");
return {
label: label,
value: item.value
@ -31,9 +35,16 @@ frappe.search.AwesomeBar = Class.extend({
item: function(item, term) {
var d = item;
var parts = item.split("%%%"),
d = { label: parts[0], value: parts[1], description: parts[2] };
d = { label: parts[0], value: parts[1], description: parts[2],
type: parts[4], prefix: parts[5]};
var html = "<span>" + __(d.label || d.value) + "</span>";
if(d.prefix) {
var html = "<span>" + __((d.prefix + ' ' + d.label)) + "</span>";
} else if(d.type) {
var html = "<span>" + __((d.label + ' ' + d.type)) + "</span>";
} else {
var html = "<span>" + __(d.label || d.value) + "</span>";
}
if(d.description && d.value!==d.description) {
html += '<br><span class="text-muted">' + __(d.description) + '</span>';
}
@ -42,29 +53,37 @@ frappe.search.AwesomeBar = Class.extend({
.html('<a style="font-weight:normal"><p>' + html + '</p></a>')
.get(0);
},
sort: function(a, b) {
sort: function(a, b) {
var a_index = a.split("%%%")[3];
var b_index = b.split("%%%")[3];
return (a_index - b_index);
return (a_index - b_index);
}
});
$input.on("input", function(e) {
var value = e.target.value;
var txt = value.trim().replace(/\s\s+/g, ' ');
var last_space = txt.lastIndexOf(' ');
if(txt && txt.length > 2) {
me.global.get_awesome_bar_options(txt.toLowerCase(), me);
}
var $this = $(this);
clearTimeout($this.data('timeout'));
$this.data('timeout', setTimeout(function(){
var value = e.target.value;
var txt = strip(value);
me.options = [];
if(txt) {
var keywords = strip(txt.toLowerCase());
me.build_options(keywords);
if(me.options.length < 2) {
me.global.get_awesome_bar_options(keywords, me);
if(txt && txt.length > 2) {
if(last_space !== -1) {
me.set_specifics(txt.slice(0,last_space), txt.slice(last_space+1));
}
me.options = me.options.concat(me.build_options(txt));
me.build_defaults(txt);
me.options = me.options.concat(me.global_results);
}
me.make_calculator(txt);
me.add_recent(txt || "");
me.add_help();
@ -112,6 +131,7 @@ frappe.search.AwesomeBar = Class.extend({
}
if(item.onclick) {
// frappe.new_doc(item.match, true);
item.onclick(item.match);
} else {
var previous_hash = window.location.hash;
@ -135,7 +155,8 @@ frappe.search.AwesomeBar = Class.extend({
this.options.push({
label: __("Help on Search"),
value: "Help on Search",
index: 20,
index: 50,
default: "Help",
onclick: function() {
var txt = '<table class="table table-bordered">\
<tr><td style="width: 50%">'+__("Make a new record")+'</td><td>'+
@ -194,7 +215,8 @@ frappe.search.AwesomeBar = Class.extend({
out.label = match[0].bold();
out.value = match[0];
}
out.index = 10
out.index = 29;
out.default = "Recent";
return out;
}, true);
},
@ -231,45 +253,106 @@ frappe.search.AwesomeBar = Class.extend({
setup_recent: function() {
this.recent = JSON.parse(frappe.boot.user.recent || "[]") || [];
},
is_present: function(txt, item) {
($.isArray(item)) ? _item = item[0] : _item = item;
_item = __(_item || '').toLowerCase().replace(/-/g, " ");
if(txt===_item || _item.indexOf(txt) !== -1) {
return item;
fuzzy_search: function(txt, _item, index) {
item = __(_item || '').toLowerCase().replace(/-/g, " ");
txt = txt.toLowerCase();
var ilen = item.length;
var tlen = txt.length;
var match_level1 = 0.5;
var match_level2 = 0.8;
var index = ((tlen/ilen) > match_level1) ? 24 : index;
var rendered_label = "";
var i, j, skips = 0, mismatches = 0;
if (tlen > ilen) {
return [];
}
if (item.indexOf(txt) !== -1) {
// prefer single words
index = (item.indexOf(' ') === -1) ? index-1 : index;
index = ((tlen/ilen) > match_level2) ? 21 : index;
var regEx = new RegExp("("+ txt +")", "ig");
rendered_label = _item.replace(regEx, '<b>$1</b>');
return [_item, index, rendered_label];
}
outer: for (i = 0, j = 0; i < tlen; i++) {
var t_ch = txt.charCodeAt(i);
if(mismatches !== 0) skips++;
if(skips > 3) return [];
mismatches = 0;
while (j < ilen) {
var i_ch = item.charCodeAt(j);
if (i_ch === t_ch) {
var item_char = _item.charAt(j);
if(item_char === item_char.toLowerCase()){
rendered_label += '<b>' + txt.charAt(i) + '</b>';
} else {
rendered_label += '<b>' + txt.charAt(i).toUpperCase() + '</b>';
}
j++;
continue outer;
}
mismatches++;
if(mismatches > 2) return [];
rendered_label += _item.charAt(j);
j++;
}
return [];
}
rendered_label += _item.slice(j);
return [_item, index + 10, rendered_label];
},
set_global_results: function(global_results){
this.options = this.options.concat(global_results);
set_specifics: function(txt, end_txt) {
var me = this;
var results = this.build_options(txt);
results.forEach(function(r) {
if((r.type).toLowerCase().indexOf(end_txt.toLowerCase()) === 0) {
if(r.index < 25) {
r.index = 21;
}
me.options.push(r);
}
});
},
build_options: function(txt) {
this.options =
this.make_global_search(txt).concat(
this.make_search_in_current(txt),
this.make_calculator(txt),
this.make_new_doc(txt),
this.make_search_in_list(txt),
this.get_doctypes(txt),
this.get_reports(txt),
this.get_pages(txt),
this.get_modules(txt)
);
build_defaults: function(txt) {
this.make_global_search(txt);
this.make_search_in_current(txt);
this.options = this.options.concat(this.make_search_in_list(txt));
},
build_options: function(txt) {
return this.make_new_doc(txt).concat(
this.get_doctypes(txt),
this.get_reports(txt),
this.get_pages(txt),
this.get_modules(txt)
);
},
set_global_results: function(global_results, txt){
this.global_results = this.global_results.concat(global_results);
},
make_global_search: function(txt) {
var me = this;
return [{
this.options.push({
label: __("Search for '" + txt.bold() + "'"),
value: __("Search for '" + txt + "'"),
match: txt,
index: 5,
index: 22,
default: "Search",
onclick: function() {
me.search.search_dialog.show();
me.search.setup_search(txt, [me.global, me.nav, me.help]);
}
}];
});
},
make_search_in_current: function(txt) {
@ -280,17 +363,18 @@ frappe.search.AwesomeBar = Class.extend({
var search_field = meta.title_field || "name";
var options = {};
options[search_field] = ["like", "%" + txt + "%"];
return [{
this.options.push({
label: __('Find {0} in {1}', [txt.bold(), route[1].bold()]),
value: __('Find {0} in {1}', [txt, route[1]]),
route_options: options,
index: 10,
index: 23,
onclick: function() {
cur_list.refresh();
},
default: "Current",
match: txt
}];
} else { return []; }
});
}
},
make_calculator: function(txt) {
@ -302,54 +386,36 @@ frappe.search.AwesomeBar = Class.extend({
try {
var val = eval(txt);
var formatted_value = __('{0} = {1}', [txt, (val + '').bold()]);
return [{
this.options.push({
label: formatted_value,
value: __('{0} = {1}', [txt, val]),
match: val,
index: 10,
index: 24,
default: "Calculator",
onclick: function() {
msgprint(formatted_value, "Result");
}
}];
});
} catch(e) {
// pass
}
} else { return []; }
},
make_new_doc: function(txt) {
var me = this;
var out = [];
if(txt.split(" ")[0]==="new") {
frappe.boot.user.can_create.forEach(function (item) {
var target = me.is_present(txt.substr(4), item);
if(target) {
out.push({
label: __("New {0}", [target.bold()]),
value: __("New {0}", [target]),
index: 10,
match: target,
onclick: function() { frappe.new_doc(target, true); }
});
}
});
}
return out;
},
make_search_in_list: function(txt) {
var me = this;
var out = [];
if(in_list(txt.split(" "), "in")) {
if(in_list(txt.split(" "), "in") && (txt.slice(-2) !== "in")) {
parts = txt.split(" in ");
frappe.boot.user.can_read.forEach(function (item) {
target = me.is_present(parts[1], item);
var target = me.fuzzy_search(parts[1], item, 21)[0];
if(target) {
out.push({
label: __('Find {0} in {1}', [__(parts[0]).bold(), __(target).bold()]),
value: __('Find {0} in {1}', [__(parts[0]), __(target)]),
route_options: {"name": ["like", "%" + parts[0] + "%"]},
index: 10,
index: 21,
default: "In List",
route: ["List", target]
});
}
@ -358,36 +424,62 @@ frappe.search.AwesomeBar = Class.extend({
return out;
},
get_doctypes: function(txt) {
make_new_doc: function(txt) {
var me = this;
var out = [];
var target, index;
var option = function(type, route) {
return {
label: __("{0} " + type, [__(target).bold()]),
value: __(target),
route: route,
index: index,
match: target
}
};
frappe.boot.user.can_read.forEach(function (item) {
target = me.is_present(txt, item);
if(target) {
var match_ratio = txt.length / item.length;
index = (match_ratio > 0.7) ? 10 : 12;
// include 'making new' option
if(in_list(frappe.boot.user.can_create, target)) {
if(txt.split(" ")[0]==="new") {
frappe.boot.user.can_create.forEach(function (item) {
var result = me.fuzzy_search(txt.substr(4), item, 21);
var target = result[0];
var rendered_label = result[2];
if(target) {
out.push({
label: __("New {0}", [target.bold()]),
label: rendered_label,
value: __("New {0}", [target]),
index: 21,
type: "New",
prefix: "New",
match: target,
index: 12,
onclick: function() { frappe.new_doc(target, true); }
});
}
});
}
return out;
},
get_doctypes: function(txt) {
var me = this;
var out = [];
var result, target, index, rendered_label;
var option = function(type, route) {
return {
label: rendered_label,
value: __(target),
route: route,
index: index,
match: target,
type: type
}
};
frappe.boot.user.can_read.forEach(function (item) {
result = me.fuzzy_search(txt, item, 25);
target = result[0];
index = result[1];
rendered_label = result[2];
if(target) {
// include 'making new' option (not working)
// if(in_list(frappe.boot.user.can_create, target)) {
// out.push({
// label: rendered_label,
// value: __("New {0}", [target]),
// index: index,
// type: "New",
// prefix: "New",
// onclick: function() { frappe.new_doc(target, true); }
// });
// }
if(in_list(frappe.boot.single_types, target)) {
out.push(option("", ["Form", target, target]));
@ -395,7 +487,7 @@ frappe.search.AwesomeBar = Class.extend({
out.push(option("Tree", ["Tree", target]));
} else {
out.push(option("List", ["List", target]));
out.push(option("List", ["List", target]));
if(frappe.model.can_get_report(target)) {
out.push(option("Report", ["Report", target]));
}
@ -414,11 +506,12 @@ frappe.search.AwesomeBar = Class.extend({
var me = this;
var out = [];
Object.keys(frappe.boot.user.all_reports).forEach(function(item) {
var target = me.is_present(txt, item);
var result = me.fuzzy_search(txt, item, 26);
var target = result[0];
var index = result[1];
var rendered_label = result[2];
if(target) {
var report = frappe.boot.user.all_reports[target];
var match_ratio = txt.length / item.length;
var index = (match_ratio > 0.7) ? 10 : 13;
var route = [];
if(report.report_type == "Report Builder")
route = ["Report", report.ref_doctype, target];
@ -426,10 +519,12 @@ frappe.search.AwesomeBar = Class.extend({
route = ["query-report", target];
out.push({
label: __("Report {0}", [__(target).bold()]),
label: rendered_label,
value: __("Report {0}" , [__(target)]),
match: txt,
index: index,
type: "Report",
prefix: "Report",
route: route
});
}
@ -446,16 +541,19 @@ frappe.search.AwesomeBar = Class.extend({
p.name = name;
});
Object.keys(this.pages).forEach(function(item) {
var target = me.is_present(txt, item);
var result = me.fuzzy_search(txt, item, 27);
var target = result[0];
var index = result[1];
var rendered_label = result[2];
if(target) {
var match_ratio = txt.length / item.length;
var index = (match_ratio > 0.7) ? 10 : 14;
var page = me.pages[target];
out.push({
label: __("Open {0}", [__(target).bold()]),
label: rendered_label,
value: __("Open {0}", [__(target)]),
match: txt,
index: index,
type: "Page",
prefix: "Open",
route: [page.route || page.name]
});
}
@ -464,10 +562,12 @@ frappe.search.AwesomeBar = Class.extend({
var target = 'Calendar';
if(__('calendar').indexOf(txt.toLowerCase()) === 0) {
out.push({
label: __("Open {0}", [__(target).bold()]),
label: rendered_label,
value: __("Open {0}", [__(target)]),
route: [target, 'Event'],
index: 14,
index: 27,
type: "Calendar",
prefix: "Open",
match: target
});
}
@ -478,17 +578,20 @@ frappe.search.AwesomeBar = Class.extend({
var me = this;
var out = [];
Object.keys(frappe.modules).forEach(function(item) {
var target = me.is_present(txt, item);
var result = me.fuzzy_search(txt, item, 28);
var target = result[0];
var index = result[1];
var rendered_label = result[2];
if(target) {
var match_ratio = txt.length / item.length;
var index = (match_ratio > 0.7) ? 10 : 15;
var module = frappe.modules[target];
if(module._doctype) return;
ret = {
label: __("Open {0}", [__(target).bold()]),
label: rendered_label,
value: __("Open {0}", [__(target)]),
match: txt,
index: index
index: index,
type: "Module",
prefix: "Open"
}
if(module.link) {
ret.route = [module.link];

View file

@ -1,5 +1,7 @@
<div class="row">
<div class="col-md-2 col-sm-2 hidden-xs layout-side-section search-sidebar">
<ul class="module-sidebar-nav overlay-sidebar nav nav-pills nav-stacked search-sidelist">
</ul>
</div>
<div class="col-md-10 col-sm-10 layout-main-section results-area">
</div>

View file

@ -12,7 +12,7 @@ frappe.search.UnifiedSearch = Class.extend({
this.search_modal.addClass('search-dialog');
this.input = this.search_modal.find(".search-input");
this.sidebar = this.search_modal.find(".search-sidebar");
this.sidelist = this.search_modal.find(".search-sidelist");
this.results_area = this.search_modal.find(".results-area");
},
@ -32,19 +32,19 @@ frappe.search.UnifiedSearch = Class.extend({
$this.data('timeout', setTimeout(function(){
var keywords = me.input.val();
me.reset();
if(keywords.length > 1) {
if(keywords.length > 2) {
me.build_results(keywords);
} else {
me.current_type = '';
}
}, 250));
}, 600));
});
this.build_results(keywords);
setTimeout(function() { me.input.select(); }, 500);
},
reset: function() {
this.sidebar.empty();
this.sidelist.empty();
this.results_area.empty();
},
@ -59,7 +59,9 @@ frappe.search.UnifiedSearch = Class.extend({
render_results: function(results_obj, keywords){
var me = this;
if(this.current === 0) { this.reset() }
this.sidebar.append(results_obj.sidelist);
results_obj.sidelist.forEach(function(list_item) {
me.sidelist.append(list_item);
})
this.results_area.find('.results-status').remove();
results_obj.sections.forEach(function(section) {
me.summary.append(section);
@ -70,18 +72,35 @@ frappe.search.UnifiedSearch = Class.extend({
bind_events: function() {
var me = this;
this.sidebar.find('.list-link').on('click', function() {
me.set_sidebar_link_action($(this));
this.results_area.on('scroll', function() {
if(me.results_area.find('.all-results-link').length !== 0) {
return;
}
var r = me.results_area.find('.module-section')[1];
me.results_area.find('.module-section').each(function() {
if(($(this).position().top < 120) && ($(this).position().top + $(this).height() > 120)) {
var types = $(this).attr('data-type').split(',');
me.sidelist.find('.list-link').removeClass('active');
types.forEach(function(type) {
me.sidelist.find('*[data-category="'+ type +'"]').addClass('active');
});
}
});
});
this.sidelist.find('.list-link').on('click', function() {
me.set_sidelist_link_action($(this));
});
this.results_area.find('.section-more').on('click', function() {
var type = $(this).attr('data-category');
me.sidebar.find('*[data-category="'+ type +'"]').trigger('click');
me.sidelist.find('*[data-category="'+ type +'"]').trigger('click');
});
},
set_sidebar_link_action: function(link) {
this.sidebar.find(".list-link a").removeClass("disabled");
link.find('a').addClass("disabled");
set_sidelist_link_action: function(link) {
this.sidelist.find(".list-link").removeClass("active");
this.sidelist.find(".list-link i").addClass("hide");
link.addClass("active");
link.find("i").removeClass("hide");
var type = link.attr('data-category');
this.results_area.empty().html(this.full_lists[type]);
@ -101,6 +120,9 @@ frappe.search.UnifiedSearch = Class.extend({
show_summary: function() {
this.current_type = '';
this.sidelist.find(".list-link i").addClass("hide");
this.sidelist.find(".list-link").removeClass("active");
this.sidelist.find(".list-link").first().addClass("active");
this.results_area.empty().html(this.summary);
this.bind_events();
},
@ -125,7 +147,7 @@ frappe.search.UnifiedSearch = Class.extend({
var no_of_results = this.results_area.find('.result').length;
var no_of_results_cue = $('<p class="results-status text-muted small">'+
no_of_results +' results found</p>');
this.results_area.find(".result:last").append(no_of_results_cue);
this.results_area.find(".more-results:last").append(no_of_results_cue);
}
this.results_area.find('.more-results.last').slideDown(200, function() {
var height = me.results_area.find('.module-body').height() - 750;
@ -144,20 +166,20 @@ frappe.search.UnifiedSearch = Class.extend({
// More searches to go
this.search_objects[this.current].build_results_object(this, keywords);
} else {
// If there's only one link in sidebar, there's no summary (show its full list)
if(this.sidebar.find('.list-link').length === 1) {
// If there's only one link in sidelist, there's no summary (show its full list)
if(this.sidelist.find('.list-link').length === 1) {
this.bind_events();
this.sidebar.find('.list-link').trigger('click');
this.sidelist.find('.list-link').trigger('click');
this.results_area.find('.all-results-link').hide();
} else if (this.sidebar.find('.list-link').length === 0) {
} else if (this.sidelist.find('.list-link').length === 0) {
this.results_area.html('<p class="results-status text-muted" style="text-align: center;">'+
'No results found for: '+ "'"+ keywords +"'" +'</p>');
} else {
var list_types = this.get_all_list_types();
if(list_types.indexOf(this.current_type) >= 0) {
this.bind_events();
this.sidebar.find('*[data-category="'+ this.current_type +'"]').trigger('click');
this.sidelist.find('*[data-category="'+ this.current_type +'"]').trigger('click');
} else {
this.show_summary();
}
@ -167,7 +189,7 @@ frappe.search.UnifiedSearch = Class.extend({
get_all_list_types: function() {
var types = [];
this.sidebar.find('.list-link').each(function() {
this.sidelist.find('.list-link').each(function() {
types.push($(this).attr('data-category'));
});
return types;
@ -214,18 +236,16 @@ frappe.search.GlobalSearch = Class.extend({
make_sidelist: function() {
var me = this;
var sidelist = $('<ul class="list-unstyled sidebar-menu nav-list"></ul>');
sidelist.append('<li class="h6">'+ me.search_type +'</li>');
var sidelist = [];
this.types.forEach(function(type) {
sidelist.append(me.make_sidelist_item(type));
sidelist.push(me.make_sidelist_item(type));
});
sidelist.append('<li class="divider"></li>');
return sidelist;
},
make_sidelist_item: function(type) {
var sidelist_item = '<li class="list-link" data-search="{0}"' +
'data-category="{1}"><a>{1}</a></li>';
var sidelist_item = '<li class="strong module-sidebar-item list-link" data-search="{0}"' +
'data-category="{1}"><a><span>{1}</span><i class="fa fa-chevron-right pull-right hide"></a></li>';
return $(__(sidelist_item, [this.search_type, type]));
},
@ -319,7 +339,7 @@ frappe.search.GlobalSearch = Class.extend({
make_section: function(type, results) {
var me = this;
var results_section = $('<div class="row module-section '+type+'-section">'+
var results_section = $('<div class="row module-section" data-type="'+type+'">'+
'<div class="col-sm-12 module-section-column">' +
'<div class="h4 section-head">'+type+'</div>' +
'<div class="section-body"></div>'+
@ -329,27 +349,53 @@ frappe.search.GlobalSearch = Class.extend({
results_col.append(me.make_result_item(type, result));
});
if(results.length > this.section_length) {
results_col.append('<a class="small section-more" data-category="'
+ type + '">More...</a>');
results_col.append('<button class="btn btn-default btn-xs text-muted section-more" data-category="'
+ type + '" style="margin-top:10px">More...</button>');
}
return results_section;
},
make_result_subtypes_property: function(results) {
var compressed_results = [];
var labels = [];
results.forEach(function(r) {
if(labels.indexOf(r.label) === -1) {
labels.push(r.label);
}
});
labels.forEach(function(l) {
var item_group = {
title: l,
subtypes: []
};
results.forEach(function(r) {
if (r.label === l) {
item_group.subtypes.push(r);
}
});
compressed_results.push(item_group);
});
return compressed_results;
},
make_full_list: function(type, results, more) {
var me = this;
var results_list = $(' <div class="module-body"><div class="row module-section '+
var results_list = $(' <div class="module-body"><div class="row module-section full-list '+
type+'-section">'+'<div class="col-sm-12 module-section-column">' +
'<div class="back-link"><a class="all-results-link small"> All Results</a></div>' +
'<div class="h4 section-head">'+type+'</div>' +
'<div class="section-body"></div>'+
'</div></div></div>');
'<div class="section-body"></div></div></div></div>');
if(type === "Lists") {
results = this.make_result_subtypes_property(results);
}
var results_col = results_list.find('.module-section-column');
results.forEach(function(result) {
results_col.append(me.make_result_item(type, result));
});
if(more) {
results_col.append('<a class="small list-more" data-search="'+ this.search_type +'" data-category="'
+ type + '">More...</a>');
results_col.append('<button class="btn btn-default btn-xs text-muted list-more" data-search="'+
this.search_type +'" data-category="'+ type + '" style="margin-top:10px"> More...</button>');
}
return results_list;
},
@ -386,7 +432,6 @@ frappe.search.GlobalSearch = Class.extend({
},
get_awesome_bar_options: function(keywords, ref) {
var me = this;
var doctypes = [];
var current = 0;
@ -426,7 +471,7 @@ frappe.search.GlobalSearch = Class.extend({
if(current < doctypes.length) {
get_results();
} else {
ref.set_global_results(results);
ref.set_global_results(results, keywords);
}
}
}
@ -434,13 +479,13 @@ frappe.search.GlobalSearch = Class.extend({
};
var make_option = function(data) {
console.log("GS search", me.get_finds(data.content, keywords).slice(0,86) + '...');
return {
label: __("{0}: {1}", [__(data.doctype).bold(), data.name]),
value: __("{0}: {1}", [__(data.doctype), data.name]),
route: ["Form", data.doctype, data.name],
match: data.doctype,
index: 5,
index: 41,
default: "Global",
description: me.get_finds(data.content, keywords).slice(0,86) + '...'
}
};
@ -455,7 +500,6 @@ frappe.search.NavSearch = frappe.search.GlobalSearch.extend({
init: function() {
this.search_type = 'Navigation';
},
set_types: function() {
var me = this;
this.section_length = 4;
@ -520,9 +564,47 @@ frappe.search.NavSearch = frappe.search.GlobalSearch.extend({
},
make_result_item: function(type, result) {
var link_html = '<div class="result '+ type +'-result single-link">' +
'<a href="{0}" class="module-section-link small">{1}</a>' +
'<p class="small"></p></div>';
if(!result.subtypes) {
var link_html = '<div class="result '+ type +'-result single-link">' +
'<a href="{0}" class="module-section-link small">{1}</a>' +
'<p class="small"></p></div>';
return this.make_result_link(type, result, link_html);
} else {
var result_div = $('<div class="result '+ type +'-result single-link"></div>');
var button_html = '<button class="btn btn-default btn-xs text-muted result-subtype"'+
'>{0}</button>'
result.subtypes.forEach(function(s) {
if(["Gantt", "Report", "Calendar"].indexOf(s.type) !== -1) {
var button = $(__(button_html, [s.type]));
button.on('click', function() {
if(s.route_options) {
frappe.route_options = s.route_options;
}
frappe.set_route(s.route);
return false;
});
result_div.append(button);
} else {
title_link_html = '<a href="{0}" class="module-section-link small">{1}</a>';
var link = $(__(title_link_html, ['#', result.title + ' ' + s.type]));
link.on('click', function() {
if(s.route_options) {
frappe.route_options = s.route_options;
}
frappe.set_route(s.route);
return false;
});
result_div.append(link);
}
})
result_div.append($('<p class="small"></p>'));
return result_div;
}
},
make_result_link: function(type, result, link_html) {
if(!result.onclick) {
var link = $(__(link_html, ['#', result.label]));
link.on('click', function() {
@ -545,9 +627,14 @@ frappe.search.NavSearch = frappe.search.GlobalSearch.extend({
make_dual_sections: function() {
this.dual_sections = [];
var section_html = '<div class="row module-section dual-section"></div>';
for(var i = 0; i < this.sections.length; i++) {
var results_section = $(section_html);
var types;
if(i+1 < this.types.length) {
types = this.types[i] + ',' + this.types[i+1];
} else {
types = this.types[i];
}
var results_section = $('<div class="row module-section dual-section" data-type="'+ types +'"></div>');
for(var j = 0; j < 2 && i < this.sections.length; j++, i++){
results_section.append(this.sections[i]);
}
@ -574,12 +661,15 @@ frappe.search.NavSearch = frappe.search.GlobalSearch.extend({
'<div class="h4 section-head">'+type+'</div>' +
'<div class="section-body"></div>'+
'</div>');
if(type === "Lists") {
results = this.make_result_subtypes_property(results);
}
results.slice(0, this.section_length).forEach(function(result) {
results_column.append(me.make_result_item(type, result));
});
if(results.length > this.section_length) {
results_column.append('<a class="small section-more" data-category="'
+ type + '">More...</a>');
results_column.append('<button class="btn btn-default btn-xs text-muted section-more" data-category="'
+ type + '" style="margin-top:10px">More...</button>');
}
return results_column;
}
@ -597,12 +687,11 @@ frappe.search.HelpSearch = frappe.search.GlobalSearch.extend({
},
make_sidelist: function() {
var sidelist = $('<ul class="list-unstyled sidebar-menu nav-list"></ul>');
var sidelist_item = '<li class="h6 list-link" data-search="'+ this.search_type + '"' +
'data-category="'+ this.search_type + '"><a style="font-size: 11px;">'+
this.search_type +'</a></li>';
sidelist.append(sidelist_item);
sidelist.append('<li class="divider"></li>');
var sidelist = [];
var sidelist_item = '<li class="strong module-sidebar-item list-link help-link" '+
'data-search="'+ this.search_type + '" data-category="'+ this.search_type + '"><a><span>'+
this.search_type +'</span><i class="fa fa-chevron-right pull-right hide"></a></li>';
sidelist.push(sidelist_item);
return sidelist;
},

View file

@ -231,7 +231,7 @@ frappe.ui.toolbar.clear_cache = function() {
frappe.ui.toolbar.download_backup = function() {
msgprint(__("Your download is being built, this may take a few moments..."));
return $c('frappe.utils.backups.get_backup',{},function(r,rt) {});
$c('frappe.utils.backups.get_backup',{},function(r,rt) {});
return false;
}

View file

@ -529,7 +529,9 @@ frappe.views.CommunicationComposer = Class.extend({
if(last_email) {
var last_email_content = last_email.original_comment || last_email.content;
fields.content.set_input(reply
fields.content.set_input(
'<p><br></p>'
+ reply
+ "<br><!-- original-reply --><br>"
+ '<blockquote>' +
'<p>' + __("On {0}, {1} wrote:",

View file

@ -88,7 +88,7 @@ frappe.views.QueryReport = Class.extend({
}, me.report_doc.letter_head);
}, true);
this.page.add_menu_item(__('Export'), function() { me.export_report(); },
this.page.add_menu_item(__('Export'), function() { me.make_export(); },
true);
this.page.add_menu_item(__("Setup Auto Email"), function() {
@ -784,18 +784,49 @@ frappe.views.QueryReport = Class.extend({
}
});
},
export_report: function() {
make_export: function() {
var me = this;
this.title = this.report_name;
if(!frappe.model.can_export(this.report_doc.ref_doctype)) {
msgprint(__("You are not allowed to export this report"));
return false;
}
var result = $.map(frappe.slickgrid_tools.get_view_data(this.columns, this.dataView),
function(row) {
return [row.splice(1)];
});
this.title = this.report_name;
frappe.tools.downloadify(result, null, this.title);
frappe.prompt({fieldtype:"Select", label: __("Select File Type"), fieldname:"file_format_type",
options:"Excel\nCSV", default:"Excel", reqd: 1},
function(data) {
if (data.file_format_type == "CSV") {
var result = $.map(frappe.slickgrid_tools.get_view_data(me.columns, me.dataView),
function(row) {
return [row.splice(1)];
});
frappe.tools.downloadify(result, null, me.title);
}
else if (data.file_format_type == "Excel") {
me.wrapper.find(".results").toggle(false);
try {
var filters = me.get_values(true);
} catch(e) {
return;
}
var args = {
cmd: 'frappe.desk.query_report.export_query',
report_name: me.report_name,
file_format_type: data.file_format_type,
filters: filters
};
open_url_post(frappe.request.url, args);
}
}, __("Export Report: "+ me.title), __("Download"));
return false;
},

View file

@ -265,6 +265,7 @@ frappe.views.ReportView = frappe.ui.Listing.extend({
filters: this.filter_list.get_filters(),
save_list_settings_fields: 1,
with_childnames: 1,
file_format_type: this.file_format_type
}
},
@ -676,11 +677,22 @@ frappe.views.ReportView = frappe.ui.Listing.extend({
}
var export_btn = this.page.add_menu_item(__('Export'), function() {
var args = me.get_args();
args.cmd = 'frappe.desk.reportview.export_query'
if(me.add_totals_row) {
args.add_totals_row = 1;
}
open_url_post(frappe.request.url, args);
frappe.prompt({fieldtype:"Select", label: __("Select File Type"), fieldname:"file_format_type",
options:"Excel\nCSV", default:"Excel", reqd: 1},
function(data) {
args.cmd = 'frappe.desk.reportview.export_query';
args.file_format_type = data.file_format_type;
if(me.add_totals_row) {
args.add_totals_row = 1;
}
open_url_post(frappe.request.url, args);
}, __("Export Report: " + me.doctype), __("Download"));
}, true);
},
@ -835,6 +847,11 @@ frappe.ui.ColumnPicker = Class.extend({
});
new Sortable(this.column_list.get(0), {
//handle: '.sortable-handle',
filter: 'input',
draggable: '.column-list-item',
chosenClass: 'sortable-chosen',
dragClass: 'sortable-chosen',
onUpdate: function(event) {
me.columns = [];
$.each($(me.dialog.body).find('.column-list .column-list-item'),
@ -856,7 +873,8 @@ frappe.ui.ColumnPicker = Class.extend({
var me = this;
var w = $('<div class="column-list-item"><div class="row">\
<div class="col-xs-1"><i class="fa fa-sort text-muted drag-handle" style="margin-top: 9px;"></i></div>\
<div class="col-xs-1">\
<i class="fa fa-sort text-muted"></i></div>\
<div class="col-xs-10"></div>\
<div class="col-xs-1"><a class="close">&times;</a></div>\
</div></div>')

View file

@ -149,7 +149,7 @@ frappe.views.TreeView = Class.extend({
var toolbar = [
{toggle_btn: true},
{
label:__("Edit"),
label:__(me.can_write? "Edit": "Details"),
condition: function(node) {
return !node.root && me.can_read;
},
@ -283,7 +283,7 @@ frappe.views.TreeView = Class.extend({
},
set_primary_action: function(){
var me = this;
if (!this.opts.disable_add_node) {
if (!this.opts.disable_add_node && this.can_create) {
me.page.set_primary_action(__("New"), function() {
me.new_node();
}, "octicon octicon-plus")

View file

@ -563,12 +563,26 @@ textarea.form-control {
}
.layout-side-section {
padding-left: 15px;
.help-link {
padding-top: 20px;
text-transform: uppercase;
}
.nav > li > a {
padding-left: 20px;
}
}
.results-area {
a {
color: #5E64FF;
}
.single-link a {
color: #36414c;
}
}
// .results-area a {
// color: #5E64FF;
// }
.module-section {
.back-link {
margin-bottom: 20px;
@ -580,13 +594,29 @@ textarea.form-control {
content: '\f0a4';
}
}
.dual-section .result a {
color: black;
.full-list {
.result {
border-bottom: 1px solid #d1d8dd;
margin-top: 10px;
.result-subtype{
float: right;
margin-left: 10px;
}
}
.section-head {
margin-bottom: 25px;
}
}
.dual-section .result a b{
color: #4e6161;
.dual-section {
.result-subtype{
display: none;
}
}
.result-status {
margin-top: 30px;
text-align: center;

View file

@ -309,6 +309,10 @@ h6.uppercase, .h6.uppercase {
.btn-more {
margin-left: 65px;
}
.gmail_extra {
display: none;
}
}
.timeline-items {

View file

@ -28,7 +28,6 @@
.column-list-item {
padding: 10px;
cursor: move;
border-bottom: 1px solid @border-color;
}
@ -36,10 +35,18 @@
border-bottom: none;
}
.drag-handle {
.sortable-handle {
cursor: move;
}
.sortable-chosen {
background-color: @light-yellow;
}
.fa-sort {
margin: 0px 7px;
position: relative;
top: -1px;
margin-top: 9px;
margin-right: -15px;
}
.form-control {

View file

@ -109,6 +109,7 @@ def get_dict(fortype, name=None):
messages = get_messages_from_file(name)
elif fortype=="boot":
messages = get_messages_from_include_files()
messages += frappe.db.sql("select 'Print Format:', name from `tabPrint Format`")
messages += frappe.db.sql("select 'DocType:', name from tabDocType")
messages += frappe.db.sql("select 'Role:', name from tabRole")
messages += frappe.db.sql("select 'Module:', name from `tabModule Def`")

View file

@ -6,7 +6,7 @@ from __future__ import unicode_literals
# IMPORTANT: only import safe functions as this module will be included in jinja environment
import frappe
import operator
import re, urllib, datetime, math
import re, urllib, datetime, math, time
import babel.dates
from babel.core import UnknownLocaleError
from dateutil import parser
@ -116,6 +116,9 @@ def now_datetime():
dt = convert_utc_to_user_timezone(datetime.datetime.utcnow())
return dt.replace(tzinfo=None)
def get_timestamp(date):
return time.mktime(getdate(date).timetuple())
def get_eta(from_time, percent_complete):
diff = time_diff(now_datetime(), from_time).total_seconds()
return str(datetime.timedelta(seconds=(100 - percent_complete) / percent_complete * diff))

View file

@ -148,4 +148,5 @@ def search_in_doctype(doctype, text, start, limit):
doctype = %s AND
match(content) against (%s IN BOOLEAN MODE)
limit {start}, {limit}'''.format(start=start, limit=limit), (doctype, text), as_dict=True)
return results
return results

View file

@ -36,7 +36,8 @@ def build_response(response_type=None):
'download': as_raw,
'json': as_json,
'page': as_page,
'redirect': redirect
'redirect': redirect,
'binary': as_binary
}
return response_type_map[frappe.response.get('type') or response_type]()
@ -68,6 +69,13 @@ def as_json():
response.data = json.dumps(frappe.local.response, default=json_handler, separators=(',',':'))
return response
def as_binary():
response = Response()
response.mimetype = 'application/octet-stream'
response.headers[b"Content-Disposition"] = ("filename=\"%s\"" % frappe.response['filename'].replace(' ', '_')).encode("utf-8")
response.data = frappe.response['filecontent']
return response
def make_logs(response = None):
"""make strings for msgprint and errprint"""
if not response:

26
frappe/utils/xlsxutils.py Normal file
View file

@ -0,0 +1,26 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import encode, cstr, cint, flt, comma_or
import openpyxl
from cStringIO import StringIO
from openpyxl.styles import Font
# return xlsx file object
def make_xlsx(data, sheet_name):
wb = openpyxl.Workbook(write_only=True)
ws = wb.create_sheet(sheet_name, 0)
row1 = ws.row_dimensions[1]
row1.font = Font(name='Calibri',bold=True)
for row in data:
ws.append(row)
xlsx_file = StringIO()
wb.save(xlsx_file)
return xlsx_file

View file

@ -22,6 +22,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Title",
@ -49,6 +50,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Published On",
@ -76,6 +78,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Published",
@ -103,6 +106,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -129,6 +133,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Blog Category",
@ -157,6 +162,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Blogger",
@ -185,6 +191,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Route",
@ -213,6 +220,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -240,6 +248,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Blog Intro",
@ -267,6 +276,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Content",
@ -294,6 +304,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Email Sent",
@ -322,7 +333,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 5,
"modified": "2016-12-29 14:40:20.508849",
"modified": "2017-02-20 13:33:26.617917",
"modified_by": "Administrator",
"module": "Website",
"name": "Blog Post",
@ -338,7 +349,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -359,7 +369,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -374,6 +383,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_order": "ASC",
"title_field": "title",
"track_changes": 1,

View file

@ -21,7 +21,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Title",
"length": 0,
"no_copy": 0,
@ -30,6 +32,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -47,7 +50,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Enabled",
"length": 0,
"no_copy": 0,
@ -56,6 +61,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -73,7 +79,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Route",
"length": 0,
"no_copy": 0,
@ -82,6 +90,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -100,7 +109,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Reference Doctype",
"length": 0,
"no_copy": 0,
@ -109,7 +120,8 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -127,7 +139,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Role",
"length": 0,
"no_copy": 0,
@ -137,6 +151,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -154,7 +169,9 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Target",
"length": 0,
"no_copy": 0,
@ -163,6 +180,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -180,7 +198,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-09-23 05:42:17.928917",
"modified": "2017-02-23 00:56:55.063155",
"modified_by": "Administrator",
"module": "Website",
"name": "Portal Menu Item",
@ -190,7 +208,9 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 0,
"track_seen": 0
}

View file

@ -22,6 +22,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Title",
@ -50,6 +51,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Title",
@ -77,6 +79,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Route",
@ -106,6 +109,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Slideshow",
@ -134,6 +138,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -161,6 +166,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Published",
@ -189,6 +195,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Show Title",
@ -218,6 +225,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Content",
@ -246,6 +254,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Main Section",
@ -273,6 +282,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Script",
@ -301,6 +311,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Insert Code",
@ -329,6 +340,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Javascript",
@ -357,6 +369,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Style",
@ -384,6 +397,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Insert Style",
@ -411,6 +425,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Text Align",
@ -440,6 +455,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "CSS",
@ -468,6 +484,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Settings",
@ -496,6 +513,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Sidebar and Comments",
@ -524,6 +542,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Show Sidebar",
@ -552,6 +571,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Website Sidebar",
@ -581,6 +601,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@ -608,6 +629,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Enable Comments",
@ -636,6 +658,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Priority",
@ -665,6 +688,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Header and Description",
@ -693,6 +717,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Description",
@ -721,6 +746,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Header",
@ -749,7 +775,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 20,
"modified": "2016-12-29 07:51:57.437822",
"modified": "2017-02-20 13:33:08.460608",
"modified_by": "Administrator",
"module": "Website",
"name": "Web Page",
@ -765,7 +791,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 0,
"read": 1,
@ -781,6 +806,7 @@
"read_only": 0,
"read_only_onload": 0,
"search_fields": "title",
"show_name_in_global_search": 1,
"sort_order": "ASC",
"title_field": "title",
"track_changes": 1,

View file

@ -24,6 +24,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Workflow Name",
@ -52,6 +53,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Document Type",
@ -81,6 +83,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Active",
@ -109,6 +112,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Don't Override Status",
@ -138,6 +142,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "States",
@ -166,6 +171,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Document States",
@ -195,6 +201,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Transition Rules",
@ -223,6 +230,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Transitions",
@ -253,6 +261,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Workflow State Field",
@ -282,7 +291,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-12-29 14:40:05.383145",
"modified": "2017-02-20 13:33:38.497751",
"modified_by": "Administrator",
"module": "Workflow",
"name": "Workflow",
@ -298,7 +307,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -313,6 +321,8 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 1,
"sort_order": "ASC",
"track_changes": 1,
"track_seen": 0
}

View file

@ -23,6 +23,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "State",
@ -51,6 +52,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Icon",
@ -80,6 +82,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Style",
@ -109,7 +112,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-12-29 14:40:34.867205",
"modified": "2017-02-20 13:33:44.011509",
"modified_by": "Administrator",
"module": "Workflow",
"name": "Workflow State",
@ -125,7 +128,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@ -140,6 +142,8 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 1,
"sort_order": "ASC",
"track_changes": 1,
"track_seen": 0
}

View file

@ -41,3 +41,4 @@ xlwt
oauthlib
PyJWT
pypdf
openpyxl