Merge branch 'develop'

This commit is contained in:
Nabin Hait 2015-11-19 14:32:41 +05:30
commit b108f39f15
113 changed files with 3872 additions and 3035 deletions

View file

@ -459,7 +459,7 @@ def has_website_permission(doctype, ptype="read", doc=None, user=None, verbose=F
def is_table(doctype):
"""Returns True if `istable` property (indicating child Table) is set for given DocType."""
def get_tables():
return db.sql_list("select name from tabDocType where ifnull(istable,0)=1")
return db.sql_list("select name from tabDocType where istable=1")
tables = cache().get_value("is_table", get_tables)
return doctype in tables
@ -755,6 +755,10 @@ def read_file(path, raise_not_found=False):
def get_attr(method_string):
"""Get python method object from its name."""
app_name = method_string.split(".")[0]
if not local.flags.in_install and app_name not in get_installed_apps():
throw(_("App {0} is not installed").format(app_name), AppNotInstalledError)
modulename = '.'.join(method_string.split('.')[:-1])
methodname = method_string.split('.')[-1]
return getattr(get_module(modulename), methodname)

View file

@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = "6.8.2"
__version__ = "6.9.0"

View file

@ -51,7 +51,7 @@ def handler(f):
@frappe.whitelist()
def get_pending_tasks_for_doc(doctype, docname):
return frappe.db.sql_list("select name from `tabAsync Task` where status in ('Queued', 'Running') and reference_doctype='%s' and reference_name='%s'" % (doctype, docname))
return frappe.db.sql_list("select name from `tabAsync Task` where status in ('Queued', 'Running') and reference_doctype=%s and reference_name=%s", (doctype, docname))
@handler

View file

@ -44,7 +44,7 @@ def get_bootinfo():
bootinfo.hidden_modules = frappe.db.get_global("hidden_modules")
bootinfo.doctype_icons = dict(frappe.db.sql("""select name, icon from
tabDocType where ifnull(icon,'')!=''"""))
bootinfo.single_types = frappe.db.sql_list("""select name from tabDocType where ifnull(issingle,0)=1""")
bootinfo.single_types = frappe.db.sql_list("""select name from tabDocType where issingle=1""")
add_home_page(bootinfo, doclist)
bootinfo.page_info = get_allowed_pages()
load_translations(bootinfo)
@ -120,7 +120,7 @@ def get_fullnames():
concat(ifnull(first_name, ''),
if(ifnull(last_name, '')!='', ' ', ''), ifnull(last_name, '')) as fullname,
user_image as image, gender, email
from tabUser where ifnull(enabled, 0)=1 and user_type!="Website User" """, as_dict=1)
from tabUser where enabled=1 and user_type!="Website User" """, as_dict=1)
d = {}
for r in ret:

View file

@ -429,7 +429,7 @@ def reset_perms(context):
frappe.init(site=site)
frappe.connect()
for d in frappe.db.sql_list("""select name from `tabDocType`
where ifnull(istable, 0)=0 and ifnull(custom, 0)=0"""):
where istable=0 and custom=0"""):
frappe.clear_cache(doctype=d)
reset_perms(d)
finally:

View file

@ -19,7 +19,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Status",
"label": "Status",
"length": 0,
"no_copy": 0,
"options": "\nQueued\nRunning\nSucceeded\nFailed\n",
"permlevel": 0,
@ -43,6 +44,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Task Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -65,6 +67,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Runtime",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -87,6 +90,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Result",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -109,6 +113,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Traceback",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -130,6 +135,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -152,6 +158,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference DocType",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@ -175,6 +182,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Doc",
"length": 0,
"no_copy": 0,
"options": "reference_doctype",
"permlevel": 0,
@ -195,7 +203,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:38.658939",
"max_attachments": 0,
"modified": "2015-11-16 06:29:42.038458",
"modified_by": "Administrator",
"module": "Core",
"name": "Async Task",

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Module",
"length": 0,
"no_copy": 0,
"options": "",
"permlevel": 0,
@ -39,7 +40,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-10-02 07:38:39.485971",
"max_attachments": 0,
"modified": "2015-11-16 06:29:42.426522",
"modified_by": "Administrator",
"module": "Core",
"name": "Block Module",

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Comment",
"length": 0,
"no_copy": 0,
"oldfieldname": "comment",
"oldfieldtype": "Text",
@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Comment Type",
"length": 0,
"no_copy": 0,
"options": "Email\nChat\nPhone\nSMS\nCreated\nSubmitted\nCancelled\nAssigned\nAssignment Completed\nComment\nWorkflow\nLabel\nAttachment\nAttachment Removed",
"permlevel": 0,
@ -64,6 +66,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Comment By",
"length": 0,
"no_copy": 0,
"oldfieldname": "comment_by",
"oldfieldtype": "Data",
@ -87,6 +90,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Comment By Fullname",
"length": 0,
"no_copy": 0,
"oldfieldname": "comment_by_fullname",
"oldfieldtype": "Data",
@ -110,6 +114,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Comment Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "comment_date",
"oldfieldtype": "Date",
@ -133,6 +138,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Comment Time",
"length": 0,
"no_copy": 0,
"oldfieldname": "comment_time",
"oldfieldtype": "Data",
@ -156,6 +162,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Comment Doctype",
"length": 0,
"no_copy": 0,
"oldfieldname": "comment_doctype",
"oldfieldtype": "Data",
@ -179,6 +186,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Comment Docname",
"length": 0,
"no_copy": 0,
"oldfieldname": "comment_docname",
"oldfieldtype": "Data",
@ -202,6 +210,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Post Topic",
"length": 0,
"no_copy": 0,
"oldfieldname": "post_topic",
"oldfieldtype": "Data",
@ -225,6 +234,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Unsubscribed",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -246,6 +256,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference DocType",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@ -270,6 +281,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Name",
"length": 0,
"no_copy": 0,
"options": "reference_doctype",
"permlevel": 0,
@ -292,7 +304,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:41.308408",
"max_attachments": 0,
"modified": "2015-11-16 06:29:43.314568",
"modified_by": "Administrator",
"module": "Core",
"name": "Comment",

View file

@ -21,7 +21,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Series",
"label": "Series",
"length": 0,
"no_copy": 0,
"options": "COMM-",
"permlevel": 0,
@ -44,7 +45,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Communication Medium",
"label": "Communication Medium",
"length": 0,
"no_copy": 0,
"options": "\nChat\nPhone\nEmail\nSMS\nVisit\nOther",
"permlevel": 0,
@ -67,6 +69,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Recipients",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -89,6 +92,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "CC",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -112,6 +116,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Phone No.",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -132,6 +137,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -153,7 +159,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Status",
"label": "Status",
"length": 0,
"no_copy": 0,
"options": "Open\nReplied\nClosed\nLinked",
"permlevel": 0,
@ -176,7 +183,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Sent or Received",
"label": "Sent or Received",
"length": 0,
"no_copy": 0,
"options": "Sent\nReceived",
"permlevel": 0,
@ -199,7 +207,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Delivery Status",
"label": "Delivery Status",
"length": 0,
"no_copy": 0,
"options": "\nSent\nBounced\nOpened\nMarked As Spam\nRejected\nDelayed\nSoft-Bounced\nClicked\nRecipient Unsubscribed",
"permlevel": 0,
@ -222,6 +231,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -244,6 +254,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Subject",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -264,6 +275,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -286,6 +298,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Content",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -308,6 +321,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "More Information",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -329,6 +343,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Sender",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -350,6 +365,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Sender Full Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -373,6 +389,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -393,6 +410,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -415,6 +433,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference DocType",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@ -438,6 +457,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Name",
"length": 0,
"no_copy": 0,
"options": "reference_doctype",
"permlevel": 0,
@ -461,6 +481,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "In Reply To",
"length": 0,
"no_copy": 0,
"options": "Communication",
"permlevel": 0,
@ -484,6 +505,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Email Account",
"length": 0,
"no_copy": 0,
"options": "Email Account",
"permlevel": 0,
@ -508,6 +530,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "User",
"length": 0,
"no_copy": 0,
"options": "User",
"permlevel": 0,
@ -531,6 +554,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Unread Notification Sent",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -553,6 +577,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "User Tags",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 1,
@ -573,7 +598,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:41.472917",
"max_attachments": 0,
"modified": "2015-11-16 06:29:43.407180",
"modified_by": "Administrator",
"module": "Core",
"name": "Communication",

View file

@ -7,6 +7,7 @@ import json
from email.utils import formataddr, parseaddr
from frappe.utils import get_url, get_formatted_email, cint, validate_email_add, split_emails
from frappe.utils.file_manager import get_file
from frappe.email.bulk import check_bulk_limit
import frappe.email.smtp
from frappe import _
@ -103,6 +104,8 @@ class Communication(Document):
self._notify(print_html=print_html, print_format=print_format, attachments=attachments,
recipients=recipients, cc=cc)
else:
check_bulk_limit(list(set(self.sent_email_addresses)))
from frappe.tasks import sendmail
sendmail.delay(frappe.local.site, self.name,
print_html=print_html, print_format=print_format, attachments=attachments,

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Key",
"length": 0,
"no_copy": 0,
"oldfieldname": "defkey",
"oldfieldtype": "Data",
@ -44,6 +45,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Value",
"length": 0,
"no_copy": 0,
"oldfieldname": "defvalue",
"oldfieldtype": "Text",
@ -67,7 +69,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-10-02 07:38:44.346115",
"max_attachments": 0,
"modified": "2015-11-16 06:29:44.604889",
"modified_by": "Administrator",
"module": "Core",
"name": "DefaultValue",

File diff suppressed because it is too large Load diff

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Role and Level",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -40,6 +41,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Role",
"length": 0,
"no_copy": 0,
"oldfieldname": "role",
"oldfieldtype": "Link",
@ -67,6 +69,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Apply User Permissions",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -89,6 +92,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "If user is the owner",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -110,6 +114,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -132,6 +137,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Level",
"length": 0,
"no_copy": 0,
"oldfieldname": "permlevel",
"oldfieldtype": "Int",
@ -159,6 +165,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "User Permission DocTypes",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -180,6 +187,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Permissions",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -202,6 +210,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Read",
"length": 0,
"no_copy": 0,
"oldfieldname": "read",
"oldfieldtype": "Check",
@ -228,6 +237,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Write",
"length": 0,
"no_copy": 0,
"oldfieldname": "write",
"oldfieldtype": "Check",
@ -254,6 +264,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Create",
"length": 0,
"no_copy": 0,
"oldfieldname": "create",
"oldfieldtype": "Check",
@ -280,6 +291,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Delete",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -300,6 +312,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -321,6 +334,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Submit",
"length": 0,
"no_copy": 0,
"oldfieldname": "submit",
"oldfieldtype": "Check",
@ -346,6 +360,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Cancel",
"length": 0,
"no_copy": 0,
"oldfieldname": "cancel",
"oldfieldtype": "Check",
@ -371,6 +386,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Amend",
"length": 0,
"no_copy": 0,
"oldfieldname": "amend",
"oldfieldtype": "Check",
@ -396,6 +412,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Additional Permissions",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -418,6 +435,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Report",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -442,6 +460,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Export",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -463,6 +482,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Import",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -485,6 +505,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Set User Permissions",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -505,6 +526,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -527,6 +549,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Share",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -550,6 +573,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Print",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -572,6 +596,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Email",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -591,7 +616,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-10-02 07:38:46.740536",
"max_attachments": 0,
"modified": "2015-11-16 06:29:45.429411",
"modified_by": "Administrator",
"module": "Core",
"name": "DocPerm",

View file

@ -21,6 +21,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "User",
"length": 0,
"no_copy": 0,
"options": "User",
"permlevel": 0,
@ -44,6 +45,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Document Type",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@ -67,6 +69,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Document Name",
"length": 0,
"no_copy": 0,
"options": "share_doctype",
"permlevel": 0,
@ -91,6 +94,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Read",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -114,6 +118,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Write",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -137,6 +142,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Share",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -159,6 +165,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Everyone",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -178,7 +185,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:47.029636",
"max_attachments": 0,
"modified": "2015-11-16 06:29:45.569747",
"modified_by": "Administrator",
"module": "Core",
"name": "DocShare",

View file

@ -21,6 +21,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
"permlevel": 0,
@ -43,6 +44,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Module",
"length": 0,
"no_copy": 0,
"oldfieldname": "module",
"oldfieldtype": "Link",
@ -68,6 +70,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is Child Table",
"length": 0,
"no_copy": 0,
"oldfieldname": "istable",
"oldfieldtype": "Check",
@ -92,6 +95,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is Single",
"length": 0,
"no_copy": 0,
"oldfieldname": "issingle",
"oldfieldtype": "Check",
@ -114,6 +118,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -134,7 +139,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Document Type",
"label": "Document Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "document_type",
"oldfieldtype": "Select",
@ -159,6 +165,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Icon",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -180,6 +187,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Custom?",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -194,13 +202,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "plugin",
"fieldname": "app",
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Plugin",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -222,6 +231,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Fields",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
"permlevel": 0,
@ -244,6 +254,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Fields",
"length": 0,
"no_copy": 0,
"oldfieldname": "fields",
"oldfieldtype": "Table",
@ -268,6 +279,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Naming",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -290,6 +302,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Auto Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "autoname",
"oldfieldtype": "Data",
@ -312,7 +325,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Name Case",
"label": "Name Case",
"length": 0,
"no_copy": 0,
"oldfieldname": "name_case",
"oldfieldtype": "Select",
@ -337,6 +351,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
"oldfieldtype": "Text",
@ -359,6 +374,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -381,6 +397,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Title Field",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -402,6 +419,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Search Fields",
"length": 0,
"no_copy": 0,
"oldfieldname": "search_fields",
"oldfieldtype": "Data",
@ -427,6 +445,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Sort Field",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -448,7 +467,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Sort Order",
"label": "Sort Order",
"length": 0,
"no_copy": 0,
"options": "ASC\nDESC",
"permlevel": 0,
@ -472,6 +492,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Permission Rules",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -494,6 +515,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Permissions",
"length": 0,
"no_copy": 0,
"oldfieldname": "permissions",
"oldfieldtype": "Table",
@ -518,6 +540,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -539,6 +562,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Permissions Settings",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -560,6 +584,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "User Cannot Create",
"length": 0,
"no_copy": 0,
"oldfieldname": "in_create",
"oldfieldtype": "Check",
@ -583,6 +608,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "User Cannot Search",
"length": 0,
"no_copy": 0,
"oldfieldname": "read_only",
"oldfieldtype": "Check",
@ -606,6 +632,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is Submittable",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -628,6 +655,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Allow Import",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -649,6 +677,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Allow Rename",
"length": 0,
"no_copy": 0,
"oldfieldname": "allow_rename",
"oldfieldtype": "Check",
@ -672,6 +701,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "In Dialog",
"length": 0,
"no_copy": 0,
"oldfieldname": "in_dialog",
"oldfieldtype": "Check",
@ -695,6 +725,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Show Print First",
"length": 0,
"no_copy": 0,
"oldfieldname": "read_only_onload",
"oldfieldtype": "Check",
@ -718,6 +749,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Max Attachments",
"length": 0,
"no_copy": 0,
"oldfieldname": "max_attachments",
"oldfieldtype": "Int",
@ -741,6 +773,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Hide Actions",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -762,6 +795,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Hide Heading",
"length": 0,
"no_copy": 0,
"oldfieldname": "hide_heading",
"oldfieldtype": "Check",
@ -785,6 +819,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Hide Toolbar",
"length": 0,
"no_copy": 0,
"oldfieldname": "hide_toolbar",
"oldfieldtype": "Check",
@ -808,6 +843,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Hide Copy",
"length": 0,
"no_copy": 0,
"oldfieldname": "allow_copy",
"oldfieldtype": "Check",
@ -831,6 +867,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Default Print Format",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -851,7 +888,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:47.199387",
"max_attachments": 0,
"modified": "2015-11-16 06:29:45.648699",
"modified_by": "Administrator",
"module": "Core",
"name": "DocType",

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "File Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "file_name",
"oldfieldtype": "Data",
@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Preview",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -64,6 +66,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Preview HTML",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -85,6 +88,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -108,6 +112,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is Home Folder",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -130,6 +135,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is Attachments Folder",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -152,6 +158,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "File Size",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -172,6 +179,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -195,6 +203,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "File URL",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -216,6 +225,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Thumbnail URL",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -238,6 +248,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Folder",
"length": 0,
"no_copy": 0,
"options": "File",
"permlevel": 0,
@ -261,6 +272,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is Folder",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -283,6 +295,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -305,6 +318,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Attached To DocType",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@ -326,6 +340,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -348,6 +363,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Attached To Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -369,6 +385,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Content Hash",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -390,6 +407,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "lft",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -412,6 +430,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "rgt",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -434,6 +453,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "old_parent",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -455,7 +475,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-19 02:13:43.935641",
"max_attachments": 0,
"modified": "2015-11-16 06:29:47.191098",
"modified_by": "Administrator",
"module": "Core",
"name": "File",

View file

@ -56,7 +56,7 @@ class TestFile(unittest.TestCase):
self.assertEqual(_("Home/Test Folder 2"), file.folder)
self.assertEqual(frappe.db.get_value("File", _("Home/Test Folder 2"), "file_size"), file.file_size)
self.assertEqual(frappe.db.get_value("File", _("Home/Test Folder 1"), "file_size"), None)
self.assertEqual(frappe.db.get_value("File", _("Home/Test Folder 1"), "file_size"), 0)
def test_folder_copy(self):
folder = self.get_folder("Test Folder 2", "Home")
@ -73,7 +73,7 @@ class TestFile(unittest.TestCase):
self.assertEqual(_("Home/Test Folder 1/Test Folder 3"), file.folder)
self.assertEqual(frappe.db.get_value("File", _("Home/Test Folder 1"), "file_size"), file.file_size)
self.assertEqual(frappe.db.get_value("File", _("Home/Test Folder 2"), "file_size"), None)
self.assertEqual(frappe.db.get_value("File", _("Home/Test Folder 2"), "file_size"), 0)
def test_non_parent_folder(self):
d = frappe.get_doc({
@ -88,7 +88,7 @@ class TestFile(unittest.TestCase):
file = frappe.get_doc("File", {"file_name":"file_copy.txt"})
file.delete()
self.assertEqual(frappe.db.get_value("File", _("Home/Test Folder 1"), "file_size"), None)
self.assertEqual(frappe.db.get_value("File", _("Home/Test Folder 1"), "file_size"), 0)
folder = self.get_folder("Test Folder 3", "Home/Test Folder 1")
self.saved_file = save_file('folder_copy.txt', "Testing folder copy example.", "", "", folder.name)

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Module Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "module_name",
"oldfieldtype": "Data",
@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "App Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -62,7 +64,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:57.452736",
"max_attachments": 0,
"modified": "2015-11-16 06:29:50.398063",
"modified_by": "Administrator",
"module": "Core",
"name": "Module Def",

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Page HTML",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
"permlevel": 0,
@ -41,6 +42,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Page Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "page_name",
"oldfieldtype": "Data",
@ -64,6 +66,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Title",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -85,6 +88,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "icon",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -105,6 +109,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -126,6 +131,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Module",
"length": 0,
"no_copy": 0,
"oldfieldname": "module",
"oldfieldtype": "Select",
@ -149,7 +155,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Standard",
"label": "Standard",
"length": 0,
"no_copy": 0,
"oldfieldname": "standard",
"oldfieldtype": "Select",
@ -173,6 +180,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -194,6 +202,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Roles",
"length": 0,
"no_copy": 0,
"oldfieldname": "roles",
"oldfieldtype": "Table",
@ -217,7 +226,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:59.403028",
"max_attachments": 0,
"modified": "2015-11-16 06:29:51.370746",
"modified_by": "Administrator",
"module": "Core",
"name": "Page",

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Role",
"length": 0,
"no_copy": 0,
"oldfieldname": "role",
"oldfieldtype": "Link",
@ -41,7 +42,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-10-02 07:38:59.530013",
"max_attachments": 0,
"modified": "2015-11-16 06:29:51.420589",
"modified_by": "Administrator",
"module": "Core",
"name": "Page Role",

View file

@ -21,6 +21,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Patch",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -41,7 +42,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:59.666628",
"max_attachments": 0,
"modified": "2015-11-16 06:29:51.487656",
"modified_by": "Administrator",
"module": "Core",
"name": "Patch Log",

View file

@ -20,6 +20,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Report Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -41,6 +42,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Ref DocType",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@ -62,7 +64,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Is Standard",
"label": "Is Standard",
"length": 0,
"no_copy": 0,
"options": "No\nYes",
"permlevel": 0,
@ -85,6 +88,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Module",
"length": 0,
"no_copy": 0,
"options": "Module Def",
"permlevel": 0,
@ -107,6 +111,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Add Total Row",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -127,6 +132,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -147,7 +153,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Report Type",
"label": "Report Type",
"length": 0,
"no_copy": 0,
"options": "Report Builder\nQuery Report\nScript Report",
"permlevel": 0,
@ -170,6 +177,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Disabled",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -193,6 +201,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Apply User Permissions",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -213,6 +222,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -235,6 +245,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Query",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -258,6 +269,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Javascript",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -280,6 +292,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "JSON",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -300,7 +313,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:39:07.933259",
"max_attachments": 0,
"modified": "2015-11-16 06:29:55.357855",
"modified_by": "Administrator",
"module": "Core",
"name": "Report",

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Role Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "role_name",
"oldfieldtype": "Data",
@ -41,7 +42,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:39:08.074305",
"max_attachments": 0,
"modified": "2015-11-16 06:29:55.424835",
"modified_by": "Administrator",
"module": "Core",
"name": "Role",

View file

@ -22,6 +22,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Seen",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -44,6 +45,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Method",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -65,6 +67,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Error",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -85,7 +88,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:39:12.348067",
"max_attachments": 0,
"modified": "2015-11-16 06:29:57.440897",
"modified_by": "Administrator",
"module": "Core",
"name": "Scheduler Log",

View file

@ -16,4 +16,4 @@ class SchedulerLog(Document):
def set_old_logs_as_seen():
frappe.db.sql("""update `tabScheduler Log` set seen=1
where ifnull(seen, 0)=0 and datediff(curdate(), creation) > 7""")
where seen=0 and datediff(curdate(), creation) > 7""")

View file

@ -20,6 +20,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Enabled",
"length": 0,
"no_copy": 0,
"oldfieldname": "enabled",
"oldfieldtype": "Check",
@ -65,6 +67,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -87,6 +90,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Email",
"length": 0,
"no_copy": 1,
"oldfieldname": "email",
"oldfieldtype": "Data",
@ -111,6 +115,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "First Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "first_name",
"oldfieldtype": "Data",
@ -134,6 +139,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Middle Name (Optional)",
"length": 0,
"no_copy": 0,
"oldfieldname": "middle_name",
"oldfieldtype": "Data",
@ -157,6 +163,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Last Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "last_name",
"oldfieldtype": "Data",
@ -182,6 +189,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Send Welcome Email",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -204,6 +212,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Unsubscribed",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -224,6 +233,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 0,
@ -249,6 +259,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Language",
"length": 0,
"no_copy": 0,
"options": "Loading...",
"permlevel": 0,
@ -272,6 +283,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Timezone",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -294,6 +306,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "User Image",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -316,6 +329,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "More Information",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -337,6 +351,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Gender",
"length": 0,
"no_copy": 0,
"oldfieldname": "gender",
"oldfieldtype": "Select",
@ -361,6 +376,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Birth Date",
"length": 0,
"no_copy": 1,
"oldfieldname": "birth_date",
"oldfieldtype": "Date",
@ -384,6 +400,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Location",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -404,6 +421,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -425,6 +443,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Bio",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -446,6 +465,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Mute Sounds",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -469,6 +489,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Change Password",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -490,6 +511,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Set New Password",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -512,6 +534,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Send Password Update Notification",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -534,6 +557,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reset Password Key",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 1,
@ -556,6 +580,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Email Settings",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -579,6 +604,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Send Notifications for Transactions I Follow",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -601,6 +627,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Email Signature",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -623,6 +650,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Desktop Background",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -645,6 +673,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Background Image",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -667,6 +696,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Background Style",
"length": 0,
"no_copy": 0,
"options": "Fill Screen\nTile",
"permlevel": 0,
@ -692,6 +722,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Roles",
"length": 0,
"no_copy": 0,
"permlevel": 1,
"print_hide": 0,
@ -713,6 +744,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Roles HTML",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -734,6 +766,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Roles Assigned",
"length": 0,
"no_copy": 0,
"options": "UserRole",
"permlevel": 1,
@ -758,6 +791,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Modules Access",
"length": 0,
"no_copy": 0,
"permlevel": 1,
"precision": "",
@ -780,6 +814,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Modules HTML",
"length": 0,
"no_copy": 0,
"permlevel": 1,
"precision": "",
@ -802,6 +837,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Block Modules",
"length": 0,
"no_copy": 0,
"options": "Block Module",
"permlevel": 1,
@ -826,6 +862,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Defaults",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 1,
@ -851,6 +888,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "User Defaults",
"length": 0,
"no_copy": 1,
"options": "DefaultValue",
"permlevel": 0,
@ -874,6 +912,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Security Settings",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
"permlevel": 0,
@ -898,6 +937,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "User Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "user_type",
"oldfieldtype": "Select",
@ -923,6 +963,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Login After",
"length": 0,
"no_copy": 0,
"permlevel": 1,
"print_hide": 0,
@ -945,6 +986,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Login Before",
"length": 0,
"no_copy": 0,
"permlevel": 1,
"print_hide": 0,
@ -967,6 +1009,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Restrict IP",
"length": 0,
"no_copy": 0,
"permlevel": 1,
"print_hide": 0,
@ -987,6 +1030,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 0,
@ -1011,6 +1055,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Last Login",
"length": 0,
"no_copy": 1,
"oldfieldname": "last_login",
"oldfieldtype": "Read Only",
@ -1034,6 +1079,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Last IP",
"length": 0,
"no_copy": 1,
"oldfieldname": "last_ip",
"oldfieldtype": "Read Only",
@ -1057,6 +1103,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Last Active",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
@ -1080,6 +1127,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Last Known Versions",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -1103,6 +1151,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Third Party Authentication",
"length": 0,
"no_copy": 0,
"permlevel": 1,
"print_hide": 0,
@ -1124,6 +1173,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Facebook Username",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -1145,6 +1195,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Facebook User ID",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -1166,6 +1217,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Google User ID",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -1186,6 +1238,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -1208,6 +1261,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Github User ID",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -1229,6 +1283,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Github Username",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -1250,7 +1305,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 5,
"modified": "2015-11-09 00:35:18.570974",
"modified": "2015-11-16 06:29:59.828065",
"modified_by": "Administrator",
"module": "Core",
"name": "User",

View file

@ -141,7 +141,7 @@ class User(Document):
return frappe.db.sql("""select distinct user.name from tabUserRole user_role, tabUser user
where user_role.role='System Manager'
and user.docstatus<2
and ifnull(user.enabled,0)=1
and user.enabled=1
and user_role.parent = user.name
and user_role.parent not in ('Administrator', %s) limit 1""", (self.name,))
@ -164,7 +164,7 @@ class User(Document):
link = get_url("/update-password?key=" + key)
self.send_login_mail(_("Verify Your Account"), "templates/emails/new_user.html",
{"link": link})
{"link": link, "site_url": get_url()})
def send_login_mail(self, subject, template, add_args):
"""send mail with login details"""
@ -397,7 +397,7 @@ def user_query(doctype, txt, searchfield, start, page_len, filters):
txt = "%{}%".format(txt)
return frappe.db.sql("""select name, concat_ws(' ', first_name, middle_name, last_name)
from `tabUser`
where ifnull(enabled, 0)=1
where enabled=1
and docstatus < 2
and name not in ({standard_users})
and user_type != 'Website User'

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Role",
"length": 0,
"no_copy": 0,
"oldfieldname": "role",
"oldfieldtype": "Link",
@ -43,7 +44,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-10-02 07:39:18.179539",
"max_attachments": 0,
"modified": "2015-11-16 06:30:00.004591",
"modified_by": "Administrator",
"module": "Core",
"name": "UserRole",

View file

@ -20,6 +20,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Ref DocType",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Docname",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -63,6 +65,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Doclist JSON",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -83,7 +86,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:39:18.235343",
"max_attachments": 0,
"modified": "2015-11-16 06:30:00.036254",
"modified_by": "Administrator",
"module": "Core",
"name": "Version",

View file

@ -38,5 +38,5 @@ def get_unread_messages():
FROM `tabComment`
WHERE comment_doctype IN ('My Company', 'Message')
AND comment_docname = %s
AND ifnull(docstatus,0)=0
AND docstatus=0
""", (frappe.session.user,))[0][0]

View file

@ -15,7 +15,7 @@ def get_roles_and_doctypes():
send_translations(frappe.get_lang_dict("doctype", "DocPerm"))
return {
"doctypes": [d[0] for d in frappe.db.sql("""select name from `tabDocType` dt where
ifnull(istable,0)=0 and
istable=0 and
name not in ('DocType') and
exists(select * from `tabDocField` where parent=dt.name)""")],
"roles": [d[0] for d in frappe.db.sql("""select name from tabRole where name not in
@ -27,8 +27,8 @@ def get_permissions(doctype=None, role=None):
frappe.only_for("System Manager")
out = frappe.db.sql("""select * from tabDocPerm
where %s%s order by parent, permlevel, role""" %
(doctype and (" parent='%s'" % doctype.replace("'", "\'")) or "",
role and ((doctype and " and " or "") + " role='%s'" % role.replace("'", "\'")) or ""),
(doctype and (" parent='%s'" % frappe.db.escape(doctype)) or "",
role and ((doctype and " and " or "") + " role='%s'" % frappe.db.escape(role)) or ""),
as_dict=True)
linked_doctypes = {}
@ -63,7 +63,7 @@ def add(parent, role, permlevel):
def update(name, doctype, ptype, value=None):
frappe.only_for("System Manager")
frappe.db.sql("""update tabDocPerm set `%s`=%s where name=%s"""\
% (ptype, '%s', '%s'), (value, name))
% (frappe.db.escape(ptype), '%s', '%s'), (value, name))
validate_and_reset(doctype)
def validate_and_reset(doctype, for_remove=False):
@ -93,7 +93,7 @@ def get_users_with_role(role):
tabUserRole.role=%s
and tabUser.name != "Administrator"
and tabUserRole.parent = tabUser.name
and ifnull(tabUser.enabled,0)=1""", role)]
and tabUser.enabled=1""", role)]
@frappe.whitelist()
def get_standard_permissions(doctype):

View file

@ -79,7 +79,7 @@ def get_doctypes_for_user_permissions():
values = user_roles
return frappe.db.sql_list("""select name from tabDocType
where ifnull(issingle,0)=0 and ifnull(istable,0)=0 {condition}""".format(condition=condition),
where issingle=0 and istable=0 {condition}""".format(condition=condition),
tuple(values))
@frappe.whitelist()

File diff suppressed because it is too large Load diff

View file

@ -20,6 +20,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "DocType",
"length": 0,
"no_copy": 0,
"oldfieldname": "dt",
"oldfieldtype": "Link",
@ -44,7 +45,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Script Type",
"label": "Script Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "script_type",
"oldfieldtype": "Select",
@ -69,6 +71,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Script",
"length": 0,
"no_copy": 0,
"oldfieldname": "script",
"oldfieldtype": "Code",
@ -93,6 +96,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Sample",
"length": 0,
"no_copy": 0,
"options": "<h3>Custom Script Help</h3>\n<p>Custom Scripts are executed only on the client-side (i.e. in Forms). Here are some examples to get you started</p>\n<pre><code>\n\n// fetch local_tax_no on selection of customer\n// cur_frm.add_fetch(link_field, source_fieldname, target_fieldname);\ncur_frm.add_fetch(\"customer\", \"local_tax_no\", \"local_tax_no\");\n\n// additional validation on dates\nfrappe.ui.form.on(\"Task\", \"validate\", function(frm) {\n if (frm.doc.from_date < get_today()) {\n msgprint(\"You can not select past date in From Date\");\n validated = false;\n }\n});\n\n// make a field read-only after saving\nfrappe.ui.form.on(\"Task\", {\n refresh: function(frm) {\n // use the __islocal value of doc, to check if the doc is saved or not\n frm.set_df_property(\"myfield\", \"read_only\", frm.doc.__islocal ? 0 : 1);\n }\n});\n\n// additional permission check\nfrappe.ui.form.on(\"Task\", {\n validate: function(frm) {\n if(user==\"user1@example.com\" && frm.doc.purpose!=\"Material Receipt\") {\n msgprint(\"You are only allowed Material Receipt\");\n validated = false;\n }\n }\n});\n\n// calculate sales incentive\nfrappe.ui.form.on(\"Sales Invoice\", {\n validate: function(frm) {\n // calculate incentives for each person on the deal\n total_incentive = 0\n $.each(frm.doc.sales_team), function(i, d) {\n\n // calculate incentive\n var incentive_percent = 2;\n if(frm.doc.base_grand_total &gt; 400) incentive_percent = 4;\n\n // actual incentive\n d.incentives = flt(frm.doc.base_grand_total) * incentive_percent / 100;\n total_incentive += flt(d.incentives)\n });\n\n frm.doc.total_incentive = total_incentive;\n }\n})\n\n</code>\n</pre>",
"permlevel": 0,
@ -114,7 +118,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:43.345211",
"max_attachments": 0,
"modified": "2015-11-16 06:29:44.183199",
"modified_by": "Administrator",
"module": "Custom",
"name": "Custom Script",

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Label and Type",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -41,6 +42,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Label",
"length": 0,
"no_copy": 0,
"oldfieldname": "label",
"oldfieldtype": "Data",
@ -64,7 +66,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Type",
"label": "Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "fieldtype",
"oldfieldtype": "Select",
@ -89,6 +92,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "fieldname",
"oldfieldtype": "Data",
@ -112,6 +116,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Mandatory",
"length": 0,
"no_copy": 0,
"oldfieldname": "reqd",
"oldfieldtype": "Check",
@ -137,6 +142,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Unique",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -159,6 +165,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "In List View",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -179,6 +186,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -202,7 +210,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Precision",
"label": "Precision",
"length": 0,
"no_copy": 0,
"options": "\n1\n2\n3\n4\n5\n6\n7\n8\n9",
"permlevel": 0,
@ -227,6 +236,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Length",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -250,6 +260,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Options",
"length": 0,
"no_copy": 0,
"oldfieldname": "options",
"oldfieldtype": "Text",
@ -273,6 +284,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Permissions",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -296,6 +308,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Depends On",
"length": 0,
"no_copy": 0,
"oldfieldname": "depends_on",
"oldfieldtype": "Data",
@ -320,6 +333,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Perm Level",
"length": 0,
"no_copy": 0,
"oldfieldname": "permlevel",
"oldfieldtype": "Int",
@ -343,6 +357,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Hidden",
"length": 0,
"no_copy": 0,
"oldfieldname": "hidden",
"oldfieldtype": "Check",
@ -368,6 +383,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Read Only",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -391,6 +407,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Collapsible",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -414,6 +431,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Collapsible Depends On",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -435,6 +453,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -457,6 +476,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Ignore User Permissions",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -478,6 +498,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Allow on Submit",
"length": 0,
"no_copy": 0,
"oldfieldname": "allow_on_submit",
"oldfieldtype": "Check",
@ -501,6 +522,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Report Hide",
"length": 0,
"no_copy": 0,
"oldfieldname": "report_hide",
"oldfieldtype": "Check",
@ -524,6 +546,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Display",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -546,6 +569,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Default",
"length": 0,
"no_copy": 0,
"oldfieldname": "default",
"oldfieldtype": "Text",
@ -569,6 +593,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "In Filter",
"length": 0,
"no_copy": 0,
"oldfieldname": "in_filter",
"oldfieldtype": "Check",
@ -593,6 +618,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -615,6 +641,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
"oldfieldtype": "Text",
@ -640,6 +667,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Print Hide",
"length": 0,
"no_copy": 0,
"oldfieldname": "print_hide",
"oldfieldtype": "Check",
@ -664,6 +692,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Print Width",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -687,6 +716,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Width",
"length": 0,
"no_copy": 0,
"oldfieldname": "width",
"oldfieldtype": "Data",
@ -712,6 +742,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Is Custom Field",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -732,7 +763,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-10-03 07:38:44.026280",
"max_attachments": 0,
"modified": "2015-11-16 06:29:44.457963",
"modified_by": "Administrator",
"module": "Custom",
"name": "Customize Form Field",

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Help",
"length": 0,
"no_copy": 0,
"options": "<div class=\"alert\">Please don't update it as it can mess up your form. Use the Customize Form View and Custom Fields to set properties!</div>",
"permlevel": 0,
@ -40,6 +41,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -61,7 +63,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "DocType or Field",
"label": "DocType or Field",
"length": 0,
"no_copy": 0,
"options": "\nDocField\nDocType",
"permlevel": 0,
@ -85,6 +88,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Set Value",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -105,6 +109,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -126,6 +131,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "DocType",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@ -150,6 +156,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Field Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -171,6 +178,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Property",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -192,6 +200,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Property Type",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -213,6 +222,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Default Value",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -233,7 +243,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:39:02.618929",
"max_attachments": 0,
"modified": "2015-11-16 06:29:52.878049",
"modified_by": "Administrator",
"module": "Custom",
"name": "Property Setter",

View file

@ -17,7 +17,7 @@ CREATE TABLE `tabDocField` (
`parent` varchar(255) DEFAULT NULL,
`parentfield` varchar(255) DEFAULT NULL,
`parenttype` varchar(255) DEFAULT NULL,
`idx` int(8) DEFAULT NULL,
`idx` int(8) NOT NULL DEFAULT 0,
`fieldname` varchar(255) DEFAULT NULL,
`label` varchar(255) DEFAULT NULL,
`oldfieldname` varchar(255) DEFAULT NULL,
@ -38,7 +38,7 @@ CREATE TABLE `tabDocField` (
`trigger` varchar(255) DEFAULT NULL,
`collapsible_depends_on` text,
`depends_on` text,
`permlevel` int(11) DEFAULT '0',
`permlevel` int(11) NOT NULL DEFAULT 0,
`ignore_user_permissions` int(1) NOT NULL DEFAULT 0,
`width` varchar(255) DEFAULT NULL,
`print_width` varchar(255) DEFAULT NULL,
@ -48,7 +48,7 @@ CREATE TABLE `tabDocField` (
`in_list_view` int(1) NOT NULL DEFAULT 0,
`read_only` int(1) NOT NULL DEFAULT 0,
`precision` varchar(255) DEFAULT NULL,
`length` int(11) DEFAULT NULL,
`length` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`name`),
KEY `parent` (`parent`),
KEY `label` (`label`),
@ -68,11 +68,11 @@ CREATE TABLE `tabDocPerm` (
`modified` datetime(6) DEFAULT NULL,
`modified_by` varchar(255) DEFAULT NULL,
`owner` varchar(255) DEFAULT NULL,
`docstatus` int(1) DEFAULT 0,
`docstatus` int(1) NOT NULL DEFAULT 0,
`parent` varchar(255) DEFAULT NULL,
`parentfield` varchar(255) DEFAULT NULL,
`parenttype` varchar(255) DEFAULT NULL,
`idx` int(8) DEFAULT NULL,
`idx` int(8) NOT NULL DEFAULT 0,
`permlevel` int(11) DEFAULT '0',
`role` varchar(255) DEFAULT NULL,
`match` varchar(255) DEFAULT NULL,
@ -104,17 +104,16 @@ CREATE TABLE `tabDocType` (
`modified` datetime(6) DEFAULT NULL,
`modified_by` varchar(255) DEFAULT NULL,
`owner` varchar(255) DEFAULT NULL,
`docstatus` int(1) DEFAULT 0,
`docstatus` int(1) NOT NULL DEFAULT 0,
`parent` varchar(255) DEFAULT NULL,
`parentfield` varchar(255) DEFAULT NULL,
`parenttype` varchar(255) DEFAULT NULL,
`idx` int(8) DEFAULT NULL,
`idx` int(8) NOT NULL DEFAULT 0,
`search_fields` varchar(255) DEFAULT NULL,
`issingle` int(1) NOT NULL DEFAULT 0,
`istable` int(1) NOT NULL DEFAULT 0,
`version` int(11) DEFAULT NULL,
`module` varchar(255) DEFAULT NULL,
`plugin` varchar(255) DEFAULT NULL,
`app` varchar(255) DEFAULT NULL,
`autoname` varchar(255) DEFAULT NULL,
`name_case` varchar(255) DEFAULT NULL,
`title_field` varchar(255) DEFAULT NULL,
@ -132,7 +131,7 @@ CREATE TABLE `tabDocType` (
`allow_import` int(1) NOT NULL DEFAULT 0,
`hide_toolbar` int(1) NOT NULL DEFAULT 0,
`hide_heading` int(1) NOT NULL DEFAULT 0,
`max_attachments` int(11) DEFAULT NULL,
`max_attachments` int(11) NOT NULL DEFAULT 0,
`print_outline` varchar(255) DEFAULT NULL,
`read_only_onload` int(1) NOT NULL DEFAULT 0,
`in_dialog` int(1) NOT NULL DEFAULT 0,
@ -156,7 +155,7 @@ CREATE TABLE `tabDocType` (
DROP TABLE IF EXISTS `tabSeries`;
CREATE TABLE `tabSeries` (
`name` varchar(100) DEFAULT NULL,
`current` int(10) DEFAULT NULL
`current` int(10) NOT NULL DEFAULT 0
) ENGINE=InnoDB ROW_FORMAT=COMPRESSED CHARACTER SET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
@ -211,16 +210,16 @@ CREATE TABLE `tabFile` (
`modified` datetime(6) DEFAULT NULL,
`modified_by` varchar(255) DEFAULT NULL,
`owner` varchar(255) DEFAULT NULL,
`docstatus` int(1) DEFAULT 0,
`docstatus` int(1) NOT NULL DEFAULT 0,
`parent` varchar(255) DEFAULT NULL,
`parentfield` varchar(255) DEFAULT NULL,
`parenttype` varchar(255) DEFAULT NULL,
`idx` int(8) DEFAULT NULL,
`idx` int(8) NOT NULL DEFAULT 0,
`file_name` varchar(255) DEFAULT NULL,
`file_url` varchar(255) DEFAULT NULL,
`module` varchar(255) DEFAULT NULL,
`attached_to_name` varchar(255) DEFAULT NULL,
`file_size` int(11) DEFAULT NULL,
`file_size` int(11) NOT NULL DEFAULT 0,
`attached_to_doctype` varchar(255) DEFAULT NULL,
PRIMARY KEY (`name`),
KEY `parent` (`parent`),
@ -239,11 +238,11 @@ CREATE TABLE `tabDefaultValue` (
`modified` datetime(6) DEFAULT NULL,
`modified_by` varchar(255) DEFAULT NULL,
`owner` varchar(255) DEFAULT NULL,
`docstatus` int(1) DEFAULT 0,
`docstatus` int(1) NOT NULL DEFAULT 0,
`parent` varchar(255) DEFAULT NULL,
`parentfield` varchar(255) DEFAULT NULL,
`parenttype` varchar(255) DEFAULT NULL,
`idx` int(8) DEFAULT NULL,
`idx` int(8) NOT NULL DEFAULT 0,
`defvalue` text,
`defkey` varchar(255) DEFAULT NULL,
PRIMARY KEY (`name`),

View file

@ -0,0 +1,11 @@
{
"app_url": "http://localhost",
"app_name": "base_vat",
"app_icon": "icon-credit-card",
"app_color": "#C0C0C0",
"app_description": "Check the VAT number depending of the country.",
"app_publisher": "Luis Fernandes",
"repo_url": "https://github.com/saguas/frappe_base_vat.git",
"app_title": "Base VAT",
"app_version": "0.0.1"
}

View file

@ -0,0 +1,11 @@
{
"app_url": "http://localhost",
"app_name": "jasper_erpnext_report",
"app_icon": "icon-file-text",
"app_color": "black",
"app_description": "Make your own reports in jasper and print them in pdf, docx, xlsx and other formats.",
"app_publisher": "Luis Fernandes",
"repo_url": "https://github.com/saguas/jasper_erpnext_report.git",
"app_title": "Jasper Erpnext Report",
"app_version": "0.1.0"
}

View file

@ -28,7 +28,7 @@ ko 한국의
lv latviešu valoda
mr मराठी
mk македонски
my Melayu
my မြန်မာ
nl nederlands
no norsk
pl polski

View file

@ -788,4 +788,4 @@ class Database:
"""Excape quotes and percent in given string."""
if isinstance(s, unicode):
s = (s or "").encode("utf-8")
return unicode(MySQLdb.escape_string(s), "utf-8").replace("%","%%")
return unicode(MySQLdb.escape_string(s), "utf-8").replace("%","%%").replace("`", "\\`")

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
"permlevel": 0,
@ -41,6 +42,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Subject",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -61,7 +63,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Event Type",
"label": "Event Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "event_type",
"oldfieldtype": "Select",
@ -87,6 +90,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Send an email reminder in the morning",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -107,6 +111,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -128,6 +133,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Starts on",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -149,6 +155,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Ends on",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -170,6 +177,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "All Day",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -190,6 +198,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -211,6 +220,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Repeat this Event",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -232,6 +242,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -253,7 +264,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Repeat On",
"label": "Repeat On",
"length": 0,
"no_copy": 0,
"options": "\nEvery Day\nEvery Week\nEvery Month\nEvery Year",
"permlevel": 0,
@ -278,6 +290,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Repeat Till",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -298,6 +311,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -320,6 +334,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Monday",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -342,6 +357,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Tuesday",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -364,6 +380,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Wednesday",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -386,6 +403,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Thursday",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -408,6 +426,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Friday",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -430,6 +449,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Saturday",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -452,6 +472,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Sunday",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -472,6 +493,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -493,6 +515,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
"oldfieldtype": "Text",
@ -518,6 +541,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Participants",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
"permlevel": 0,
@ -540,6 +564,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Groups",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 0,
@ -564,6 +589,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Roles",
"length": 0,
"no_copy": 0,
"oldfieldname": "event_roles",
"oldfieldtype": "Table",
@ -588,6 +614,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Ref Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "ref_type",
"oldfieldtype": "Data",
@ -612,6 +639,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Ref Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "ref_name",
"oldfieldtype": "Data",
@ -635,7 +663,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:49.897665",
"max_attachments": 0,
"modified": "2015-11-16 06:29:46.775883",
"modified_by": "Administrator",
"module": "Desk",
"name": "Event",

View file

@ -77,27 +77,28 @@ def get_events(start, end, user=None, for_reminder=False):
starts_on, ends_on, owner, all_day, event_type, repeat_this_event, repeat_on,repeat_till,
monday, tuesday, wednesday, thursday, friday, saturday, sunday
from tabEvent where ((
(date(starts_on) between date('%(start)s') and date('%(end)s'))
or (date(ends_on) between date('%(start)s') and date('%(end)s'))
or (date(starts_on) <= date('%(start)s') and date(ends_on) >= date('%(end)s'))
(date(starts_on) between date(%(start)s) and date(%(end)s))
or (date(ends_on) between date(%(start)s) and date(%(end)s))
or (date(starts_on) <= date(%(start)s) and date(ends_on) >= date(%(end)s))
) or (
date(starts_on) <= date('%(start)s') and ifnull(repeat_this_event,0)=1 and
ifnull(repeat_till, "3000-01-01") > date('%(start)s')
date(starts_on) <= date(%(start)s) and repeat_this_event=1 and
ifnull(repeat_till, "3000-01-01") > date(%(start)s)
))
%(reminder_condition)s
and (event_type='Public' or owner='%(user)s'
{reminder_condition}
and (event_type='Public' or owner=%(user)s
or exists(select name from `tabDocShare` where
tabDocShare.share_doctype="Event" and `tabDocShare`.share_name=tabEvent.name
and tabDocShare.user='%(user)s')
and tabDocShare.user=%(user)s)
or exists(select * from `tabEvent Role` where
`tabEvent Role`.parent=tabEvent.name
and `tabEvent Role`.role in ('%(roles)s')))
order by starts_on""" % {
and `tabEvent Role`.role in ({roles})))
order by starts_on""".format(
reminder_condition="and ifnull(send_reminder,0)=1" if for_reminder else "",
roles=", ".join('"{}"'.format(frappe.db.escape(r)) for r in roles)
), {
"start": start,
"end": end,
"reminder_condition": "and ifnull(send_reminder,0)=1" if for_reminder else "",
"user": user,
"roles": "', '".join(roles)
}, as_dict=1)
# process recurring events

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Role",
"length": 0,
"no_copy": 0,
"oldfieldname": "role",
"oldfieldtype": "Link",
@ -43,7 +44,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-10-02 07:38:50.115057",
"max_attachments": 0,
"modified": "2015-11-16 06:29:46.887139",
"modified_by": "Administrator",
"module": "Desk",
"name": "Event Role",

View file

@ -1,197 +1,204 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "hash",
"creation": "2012-07-03 13:29:42",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "hash",
"creation": "2012-07-03 13:29:42",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "feed_type",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Feed Type",
"no_copy": 0,
"options": "\nComment\nLogin\nLabel\nInfo",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "feed_type",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Feed Type",
"length": 0,
"no_copy": 0,
"options": "\nComment\nLogin\nLabel\nInfo",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "doc_type",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Doc Type",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "doc_type",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Doc Type",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "doc_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Doc Name",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "doc_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Doc Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "subject",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Subject",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "subject",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Subject",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "color",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Color",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "color",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Color",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "full_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Full Name",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "full_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Full Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-rss",
"idx": 1,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-11-14 12:10:57.103185",
"modified_by": "Administrator",
"module": "Desk",
"name": "Feed",
"owner": "Administrator",
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-rss",
"idx": 1,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2015-11-16 06:29:47.123186",
"modified_by": "Administrator",
"module": "Desk",
"name": "Feed",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
},
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 0,
"export": 0,
"if_owner": 1,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 0,
"role": "All",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 0,
"export": 0,
"if_owner": 1,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 0,
"role": "All",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
}
],
"read_only": 0,
],
"read_only": 0,
"read_only_onload": 0
}
}

View file

@ -20,6 +20,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Title",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 1,
@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Public",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 1,
@ -64,6 +66,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Content",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -84,7 +87,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:57.968895",
"max_attachments": 0,
"modified": "2015-11-16 06:29:50.709322",
"modified_by": "Administrator",
"module": "Desk",
"name": "Note",

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Description and Status",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -40,6 +41,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
"oldfieldtype": "Text",
@ -64,6 +66,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -85,7 +88,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Status",
"label": "Status",
"length": 0,
"no_copy": 0,
"options": "Open\nClosed",
"permlevel": 0,
@ -108,7 +112,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Priority",
"label": "Priority",
"length": 0,
"no_copy": 0,
"oldfieldname": "priority",
"oldfieldtype": "Data",
@ -133,6 +138,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Due Date",
"length": 0,
"no_copy": 0,
"oldfieldname": "date",
"oldfieldtype": "Date",
@ -156,6 +162,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Allocated To",
"length": 0,
"no_copy": 0,
"options": "User",
"permlevel": 0,
@ -178,6 +185,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -199,6 +207,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "reference_type",
"oldfieldtype": "Data",
@ -223,6 +232,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "reference_name",
"oldfieldtype": "Data",
@ -246,6 +256,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -267,6 +278,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Role",
"length": 0,
"no_copy": 0,
"oldfieldname": "role",
"oldfieldtype": "Link",
@ -291,6 +303,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Assigned By",
"length": 0,
"no_copy": 0,
"options": "User",
"permlevel": 0,
@ -313,6 +326,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Sender",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -335,7 +349,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2015-10-02 07:39:17.248993",
"modified": "2015-11-16 06:29:59.631791",
"modified_by": "Administrator",
"module": "Desk",
"name": "ToDo",

View file

@ -108,8 +108,8 @@ def get_comments(dt, dn, limit=100):
reference_doctype, reference_name, comment_type, "Comment" as doctype
from `tabComment`
where comment_doctype=%s and comment_docname=%s
order by creation desc limit %s""" % ('%s','%s', limit),
(dt, dn), as_dict=1)
order by creation desc limit %s""",
(dt, dn, limit), as_dict=1)
communications = frappe.db.sql("""select name,
content as comment, sender as comment_by, creation,
@ -117,7 +117,7 @@ def get_comments(dt, dn, limit=100):
"Communication" as doctype
from tabCommunication
where reference_doctype=%s and reference_name=%s
order by creation desc limit {0}""".format(limit), (dt, dn),
order by creation desc limit %s""", (dt, dn, limit),
as_dict=True)
for c in communications:

View file

@ -121,7 +121,7 @@ class FormMeta(Meta):
def load_print_formats(self):
print_formats = frappe.db.sql("""select * FROM `tabPrint Format`
WHERE doc_type=%s AND docstatus<2 and ifnull(disabled, 0)=0""", (self.name,), as_dict=1,
WHERE doc_type=%s AND docstatus<2 and disabled=0""", (self.name,), as_dict=1,
update={"doctype":"Print Format"})
self.set("__print_formats", print_formats, as_value=True)

View file

@ -15,22 +15,6 @@ def remove_attach():
fid = frappe.form_dict.get('fid')
return frappe.utils.file_manager.remove_file(fid)
@frappe.whitelist()
def get_fields():
"""get fields"""
r = {}
args = {
'select':frappe.form_dict.get('select')
,'from':frappe.form_dict.get('from')
,'where':frappe.form_dict.get('where')
}
ret = frappe.db.sql("select %(select)s from `%(from)s` where %(where)s limit 1" % args)
if ret:
fl, i = frappe.form_dict.get('fields').split(','), 0
for f in fl:
r[f], i = ret[0][i], i+1
frappe.response['message']=r
@frappe.whitelist()
def validate_link():
"""validate link when updated by user"""
@ -44,16 +28,16 @@ def validate_link():
frappe.response['message'] = 'Ok'
return
if frappe.db.sql("select name from `tab%s` where name=%s" % (options, '%s'), (value,)):
if frappe.db.sql("select name from `tab%s` where name=%s" % (frappe.db.escape(options), '%s'), (value,)):
# get fetch values
if fetch:
# escape with "`"
fetch = ", ".join(("`{0}`".format(f.strip()) for f in fetch.split(",")))
fetch = ", ".join(("`{0}`".format(frappe.db.escape(f.strip())) for f in fetch.split(",")))
frappe.response['fetch_values'] = [frappe.utils.parse_val(c) \
for c in frappe.db.sql("select %s from `tab%s` where name=%s" \
% (fetch, options, '%s'), (value,))[0]]
% (fetch, frappe.db.escape(options), '%s'), (value,))[0]]
frappe.response['message'] = 'Ok'

View file

@ -90,10 +90,10 @@ def add_custom_doctypes(data, doctype_info):
def get_doctype_info(module):
"""Returns list of non child DocTypes for given module."""
doctype_info = frappe.db.sql("""select "doctype" as type, name, description,
ifnull(document_type, "") as document_type, ifnull(custom, 0) as custom,
ifnull(issingle, 0) as issingle
from `tabDocType` where module=%s and ifnull(istable, 0)=0
order by ifnull(custom, 0) asc, document_type desc, name asc""", module, as_dict=True)
ifnull(document_type, "") as document_type, custom as custom,
issingle as issingle
from `tabDocType` where module=%s and istable=0
order by custom asc, document_type desc, name asc""", module, as_dict=True)
for d in doctype_info:
d.description = _(d.description or "")

View file

@ -3,8 +3,14 @@
from __future__ import unicode_literals
import frappe
import frappe.utils
import frappe.installer
import frappe.sessions
import subprocess
import os
import json
from frappe import _
from distutils.spawn import find_executable
@frappe.whitelist()
def get_app_list():
@ -25,12 +31,40 @@ def get_app_list():
if app in installed:
out[app]["installed"] = 1
app_listing = get_app_listing()
app_listing = {app:app_listing[app] for app in app_listing if app not in installed}
out.update(app_listing)
return out
def get_app_listing():
apps_listing_dir = os.path.join(os.path.dirname(frappe.__file__), 'data', 'app_listing')
def get_app_path(app, *path):
return os.path.join(apps_listing_dir, app, *path)
out = {}
apps = [app for app in os.listdir(apps_listing_dir)
if os.path.isdir(get_app_path(app)) and
os.path.exists(get_app_path(app, 'data.json'))]
for app in apps:
with open(get_app_path(app, 'data.json')) as f:
out[app] = json.load(f)
return out
@frappe.whitelist()
def install_app(name):
if name not in frappe.get_all_apps(True):
get_app(name)
frappe.cache().delete_value(["app_hooks"])
# reload sys.path
import site
reload(site)
app_hooks = frappe.get_hooks(app_name=name)
if app_hooks.get('hide_in_installer'):
frappe.throw(_("You cannot install this app"))
frappe.installer.install_app(name)
def get_app(name):
app_listing = get_app_listing()
if name not in app_listing:
raise frappe.ValidationError
subprocess.check_call([find_executable('bench'), 'get-app', name, app_listing[name]['repo_url']], cwd=frappe.utils.get_bench_path())

View file

@ -53,7 +53,7 @@ def get_active_users():
(select count(*) from tabSessions where user=tabUser.name
and timediff(now(), lastupdate) < time("01:00:00")) as has_session
from tabUser
where ifnull(enabled,0)=1 and
where enabled=1 and
ifnull(user_type, '')!='Website User' and
name not in ({})
order by first_name""".format(", ".join(["%s"]*len(STANDARD_USERS))), STANDARD_USERS, as_dict=1)

View file

@ -81,7 +81,7 @@ def search_widget(doctype, txt, query=None, searchfield=None, start=0,
# find relevance as location of search term from the beginning of string `name`. used for sorting results.
fields.append("""locate("{_txt}", `tab{doctype}`.`name`) as `_relevance`""".format(
_txt=frappe.db.escape((txt or "").replace("%", "")), doctype=doctype))
_txt=frappe.db.escape((txt or "").replace("%", "")), doctype=frappe.db.escape(doctype)))
values = frappe.desk.reportview.execute(doctype,
filters=filters, fields=fields,

View file

@ -62,7 +62,7 @@ def get_tags(doctype, txt):
for _user_tags in frappe.db.sql_list("""select `_user_tags`
from `tab{0}`
where _user_tags like '%{1}%'
limit 1""".format(doctype, frappe.db.escape(txt))):
limit 1""".format(frappe.db.escape(doctype), frappe.db.escape(txt))):
tags.extend(_user_tags.split(","))
except Exception, e:
if e.args[0]!=1054: raise

View file

@ -28,11 +28,11 @@ def sendmail_to_system_managers(subject, content):
@frappe.whitelist()
def get_contact_list():
"""Returns contacts (from autosuggest)"""
cond = ['`%s` like "%s%%"' % (f,
frappe.form_dict.get('txt')) for f in frappe.form_dict.get('where').split(',')]
cond = ['`%s` like "%s%%"' % (frappe.db.escape(f),
frappe.db.escape(frappe.form_dict.get('txt'))) for f in frappe.form_dict.get('where').split(',')]
cl = frappe.db.sql("select `%s` from `tab%s` where %s" % (
frappe.form_dict.get('select')
,frappe.form_dict.get('from')
frappe.db.escape(frappe.form_dict.get('select'))
,frappe.db.escape(frappe.form_dict.get('from'))
,' OR '.join(cond)
)
)

View file

@ -48,7 +48,7 @@ def send(recipients=None, sender=None, subject=None, message=None, reference_doc
if not sender or sender == "Administrator":
email_account = get_outgoing_email_account()
sender = email_account.get("sender") or email_account.email_id
sender = email_account.default_sender
check_bulk_limit(recipients)
@ -145,7 +145,7 @@ def check_bulk_limit(recipients):
monthly_bulk_mail_limit = frappe.conf.get('monthly_bulk_mail_limit') or 500
if (this_month + len(recipients)) > monthly_bulk_mail_limit:
throw(_("Email limit {0} crossed").format(monthly_bulk_mail_limit),
throw(_("Cannot send this email. You have crossed the sending limit of {0} emails for this month.").format(monthly_bulk_mail_limit),
BulkLimitCrossedError)
def get_unsubscribe_link(reference_doctype, reference_name,

View file

@ -21,6 +21,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Sender",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Recipient",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -63,6 +65,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Message",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -84,7 +87,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Status",
"label": "Status",
"length": 0,
"no_copy": 0,
"options": "\nNot Sent\nSending\nSent\nError",
"permlevel": 0,
@ -107,6 +111,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Error",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -128,6 +133,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference DocType",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@ -150,6 +156,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference DocName",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -171,6 +178,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Send After",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
@ -194,6 +202,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Priority",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -215,7 +224,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:40.795371",
"max_attachments": 0,
"modified": "2015-11-16 06:29:43.089602",
"modified_by": "Administrator",
"module": "Email",
"name": "Bulk Email",

File diff suppressed because it is too large Load diff

View file

@ -21,6 +21,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Enabled",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Filters",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -64,6 +66,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Subject",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -85,6 +88,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Document Type",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@ -107,6 +111,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Send Alert On",
"length": 0,
"no_copy": 0,
"options": "\nNew\nSave\nSubmit\nCancel\nDays After\nDays Before\nValue Change",
"permlevel": 0,
@ -131,6 +136,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -155,6 +161,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Days Before or After",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -178,6 +185,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Value Changed",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -201,6 +209,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Condition",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -221,6 +230,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -241,6 +251,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"options": "<p><strong>Condition Examples:</strong></p>\n<pre>doc.status==\"Open\"\ndoc.due_date==nowdate()\ndoc.total > 40000\n</pre>\n<p><strong>Hints:</strong></p>\n<ol>\n<li>To check for an event every day, select \"Date Change\" in Event</li>\n<li>To send an alert if a particular value changes, select \"Value Change\"</li>\n</ol>",
"permlevel": 0,
@ -263,6 +274,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Recipients",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -284,6 +296,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Recipients",
"length": 0,
"no_copy": 0,
"options": "Email Alert Recipient",
"permlevel": 0,
@ -306,6 +319,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Message",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -327,6 +341,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Message",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -348,6 +363,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Attach Print",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -370,6 +386,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Message Examples",
"length": 0,
"no_copy": 0,
"options": "<h5>Message Example</h5>\n\n<pre>\n<h3>Order Overdue</h3>\n\n<p>Transaction {{ doc.name }} has exceeded Due Date. Please take necessary action.</p>\n\n<h4>Details</h4>\n\n<ul>\n<li>Customer: {{ doc.customer }}\n<li>Amount: {{ doc.total_amount }}\n</ul>\n</pre>",
"permlevel": 0,
@ -392,6 +409,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "View Properties (via Customize Form)",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -412,7 +430,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-16 01:35:51.254775",
"max_attachments": 0,
"modified": "2015-11-16 06:29:46.014034",
"modified_by": "Administrator",
"module": "Email",
"name": "Email Alert",

View file

@ -20,6 +20,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Email By Document Field",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "CC",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -64,6 +66,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Condition",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -82,7 +85,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-10-02 07:38:48.185785",
"max_attachments": 0,
"modified": "2015-11-16 06:29:46.092268",
"modified_by": "Administrator",
"module": "Email",
"name": "Email Alert Recipient",

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Email",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -41,6 +42,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Reference DocType",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@ -64,6 +66,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Reference Name",
"length": 0,
"no_copy": 0,
"options": "reference_doctype",
"permlevel": 0,
@ -87,6 +90,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Global Unsubscribe",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -106,7 +110,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:48.744583",
"max_attachments": 0,
"modified": "2015-11-16 06:29:46.223148",
"modified_by": "Administrator",
"module": "Email",
"name": "Email Unsubscribe",

View file

@ -20,6 +20,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Subject",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -41,6 +42,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Response",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -63,6 +65,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Owner",
"length": 0,
"no_copy": 0,
"options": "User",
"permlevel": 0,
@ -83,7 +86,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-11-05 01:48:30.209422",
"max_attachments": 0,
"modified": "2015-11-16 06:29:57.875243",
"modified_by": "Administrator",
"module": "Email",
"name": "Standard Reply",

View file

@ -161,8 +161,7 @@ class EMail:
self.add_attachment(name, get_pdf(html, options), 'application/octet-stream')
def get_default_sender(self):
email_account = get_outgoing_email_account()
return email.utils.formataddr((email_account.name, email_account.get("sender") or email_account.get("email_id")))
return get_outgoing_email_account().default_sender
def validate(self):
"""validate the email ids"""

View file

@ -5,6 +5,7 @@ from __future__ import unicode_literals
import frappe
import smtplib
import email.utils
import _socket
from frappe.utils import cint
from frappe import _
@ -58,6 +59,9 @@ def get_outgoing_email_account(raise_exception_not_set=True, append_to=None):
frappe.throw(_("Please setup default Email Account from Setup > Email > Email Account"),
frappe.OutgoingEmailError)
email_account.default_sender = email.utils.formataddr((email_account.name,
email_account.get("sender") or email_account.get("email_id")))
frappe.local.outgoing_email_account[append_to or "default"] = email_account
return frappe.local.outgoing_email_account[append_to or "default"]

View file

@ -58,3 +58,4 @@ class LinkExistsError(ValidationError): pass
class InvalidEmailAddressError(ValidationError): pass
class TemplateNotFoundError(ValidationError): pass
class UniqueValidationError(ValidationError): pass
class AppNotInstalledError(ValidationError): pass

View file

@ -20,6 +20,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Country Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "country_name",
"oldfieldtype": "Data",
@ -43,6 +44,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Date Format",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -64,6 +66,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Time Zones",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -85,6 +88,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Code",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -105,7 +109,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:42.770807",
"max_attachments": 0,
"modified": "2015-11-16 06:29:43.937722",
"modified_by": "Administrator",
"module": "Geo",
"name": "Country",

View file

@ -21,6 +21,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Currency Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "currency_name",
"oldfieldtype": "Data",
@ -44,6 +45,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Enabled",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -66,6 +68,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Fraction",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -88,6 +91,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Fraction Units",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -110,6 +114,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Symbol",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -131,7 +136,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Number Format",
"label": "Number Format",
"length": 0,
"no_copy": 0,
"options": "\n#,###.##\n#.###,##\n# ###.##\n# ###,##\n#'###.##\n#, ###.##\n#,##,###.##\n#,###.###\n#.###\n#,###",
"permlevel": 0,
@ -153,7 +159,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:42.863135",
"max_attachments": 0,
"modified": "2015-11-16 06:29:43.978225",
"modified_by": "Administrator",
"module": "Geo",
"name": "Currency",

View file

@ -60,7 +60,9 @@ def uploadfile():
frappe.db.rollback()
else:
if frappe.form_dict.get('method'):
ret = frappe.get_attr(frappe.form_dict.method)()
method = frappe.get_attr(frappe.form_dict.method)
is_whitelisted(method)
ret = method()
except Exception:
frappe.errprint(frappe.utils.get_traceback())
ret = None
@ -87,6 +89,15 @@ def execute_cmd(cmd, from_async=False):
if from_async:
method = method.queue
is_whitelisted(method)
ret = frappe.call(method, **frappe.form_dict)
# returns with a message
if ret:
frappe.response['message'] = ret
def is_whitelisted(method):
# check if whitelisted
if frappe.session['user'] == 'Guest':
if (method not in frappe.guest_methods):
@ -106,12 +117,6 @@ def execute_cmd(cmd, from_async=False):
frappe.msgprint(_("Not permitted"))
raise frappe.PermissionError('Not Allowed, {0}'.format(method))
ret = frappe.call(method, **frappe.form_dict)
# returns with a message
if ret:
frappe.response['message'] = ret
def get_attr(cmd):
"""get method object from cmd"""
if '.' in cmd:

View file

@ -27,7 +27,7 @@ to ERPNext.
"""
app_icon = "octicon octicon-circuit-board"
app_version = "6.8.2"
app_version = "6.9.0"
app_color = "orange"
source_link = "https://github.com/frappe/frappe"
app_license = "MIT"

View file

@ -180,9 +180,12 @@ class BaseDocument(object):
df = self.meta.get_field(fieldname)
if df:
if df.fieldtype=="Check" and not isinstance(d[fieldname], int):
if df.fieldtype in ("Check", "Int") and not isinstance(d[fieldname], int):
d[fieldname] = cint(d[fieldname])
elif df.fieldtype in ("Currency", "Float", "Percent") and not isinstance(d[fieldname], float):
d[fieldname] = flt(d[fieldname])
elif df.fieldtype in ("Datetime", "Date") and d[fieldname]=="":
d[fieldname] = None
@ -197,6 +200,9 @@ class BaseDocument(object):
if key not in self.__dict__:
self.__dict__[key] = None
if key in ("idx", "docstatus") and self.__dict__[key] is None:
self.__dict__[key] = 0
for key in self.get_valid_columns():
if key not in self.__dict__:
self.__dict__[key] = None
@ -448,19 +454,19 @@ class BaseDocument(object):
def _validate_length(self):
if frappe.flags.in_install:
return
for fieldname, value in self.get_valid_dict().iteritems():
df = self.meta.get_field(fieldname)
if df and df.fieldtype in type_map and type_map[df.fieldtype][0]=="varchar":
max_length = cint(df.get("length")) or cint(varchar_len)
if len(cstr(value)) > max_length:
if self.parentfield and self.idx:
reference = _("{0}, Row {1}").format(_(self.doctype), self.idx)
else:
reference = "{0} {1}".format(_(self.doctype), self.name)
frappe.throw(_("{0}: '{1}' will get truncated, as max characters allowed is {2}")\
.format(reference, _(df.label), max_length), frappe.CharacterLengthExceededError)

View file

@ -12,7 +12,7 @@ import re
import os
import frappe
from frappe import _
from frappe.utils import cstr, cint
from frappe.utils import cstr, cint, flt
import MySQLdb
class InvalidColumnName(frappe.ValidationError): pass
@ -56,7 +56,7 @@ def updatedb(dt):
* updates columns
* updates indices
"""
res = frappe.db.sql("select ifnull(issingle, 0) from tabDocType where name=%s", (dt,))
res = frappe.db.sql("select issingle from tabDocType where name=%s", (dt,))
if not res:
raise Exception, 'Wrong doctype "%s" in updatedb' % dt
@ -155,11 +155,11 @@ class DbTable:
modified datetime(6),
modified_by varchar({varchar_len}),
owner varchar({varchar_len}),
docstatus int(1) default '0',
docstatus int(1) not null default '0',
parent varchar({varchar_len}),
parentfield varchar({varchar_len}),
parenttype varchar({varchar_len}),
idx int(8),
idx int(8) not null default '0',
%sindex parent(parent))
ENGINE=InnoDB
ROW_FORMAT=COMPRESSED
@ -289,11 +289,15 @@ class DbTable:
if col.fieldname=="name":
continue
if col.fieldtype=="Check":
if col.fieldtype in ("Check", "Int"):
col_default = cint(col.default)
elif col.fieldtype in ("Currency", "Float", "Percent"):
col_default = flt(col.default)
elif not col.default:
col_default = "null"
else:
col_default = '"{}"'.format(col.default.replace('"', '\\"'))
@ -331,10 +335,14 @@ class DbColumn:
if not column_def:
return column_def
if self.fieldtype=="Check":
if self.fieldtype in ("Check", "Int"):
default_value = cint(self.default) or 0
column_def += ' not null default {0}'.format(default_value)
elif self.fieldtype in ("Currency", "Float", "Percent"):
default_value = flt(self.default) or 0
column_def += ' not null default {0}'.format(default_value)
elif self.default and (self.default not in default_shortcuts) \
and not self.default.startswith(":") and column_def not in ('text', 'longtext'):
column_def += ' default "' + self.default.replace('"', '\"') + '"'
@ -516,7 +524,7 @@ def validate_column_name(n):
def remove_all_foreign_keys():
frappe.db.sql("set foreign_key_checks = 0")
frappe.db.commit()
for t in frappe.db.sql("select name from tabDocType where ifnull(issingle,0)=0"):
for t in frappe.db.sql("select name from tabDocType where issingle=0"):
dbtab = DbTable(t[0])
try:
fklist = dbtab.get_foreign_keys()

View file

@ -107,7 +107,7 @@ def delete_from_table(doctype, name, ignore_doctypes, doc):
if doctype!="DocType" and doctype==name:
frappe.db.sql("delete from `tabSingles` where doctype=%s", name)
else:
frappe.db.sql("delete from `tab%s` where name=%s" % (doctype, "%s"), (name,))
frappe.db.sql("delete from `tab%s` where name=%s" % (frappe.db.escape(doctype), "%s"), (name,))
# get child tables
if doc:

View file

@ -79,13 +79,13 @@ def rename_versions(doctype, old, new):
def rename_parent_and_child(doctype, old, new, meta):
# rename the doc
frappe.db.sql("update `tab%s` set name=%s where name=%s" % (doctype, '%s', '%s'),
frappe.db.sql("update `tab%s` set name=%s where name=%s" % (frappe.db.escape(doctype), '%s', '%s'),
(new, old))
update_child_docs(old, new, meta)
def validate_rename(doctype, new, meta, merge, force, ignore_permissions):
# using for update so that it gets locked and someone else cannot edit it while this rename is going on!
exists = frappe.db.sql("select name from `tab{doctype}` where name=%s for update".format(doctype=doctype), new)
exists = frappe.db.sql("select name from `tab{doctype}` where name=%s for update".format(doctype=frappe.db.escape(doctype)), new)
exists = exists[0][0] if exists else None
if merge and not exists:
@ -130,7 +130,7 @@ def update_child_docs(old, new, meta):
# update "parent"
for df in meta.get_table_fields():
frappe.db.sql("update `tab%s` set parent=%s where parent=%s" \
% (df.options, '%s', '%s'), (new, old))
% (frappe.db.escape(df.options), '%s', '%s'), (new, old))
def update_link_field_values(link_fields, old, new, doctype):
for field in link_fields:
@ -146,15 +146,15 @@ def update_link_field_values(link_fields, old, new, doctype):
frappe.db.sql("""\
update `tab%s` set `%s`=%s
where `%s`=%s""" \
% (parent, field['fieldname'], '%s',
field['fieldname'], '%s'),
% (frappe.db.escape(parent), frappe.db.escape(field['fieldname']), '%s',
frappe.db.escape(field['fieldname']), '%s'),
(new, old))
def get_link_fields(doctype):
# get link fields from tabDocField
link_fields = frappe.db.sql("""\
select parent, fieldname,
(select ifnull(issingle, 0) from tabDocType dt
(select issingle from tabDocType dt
where dt.name = df.parent) as issingle
from tabDocField df
where
@ -163,7 +163,7 @@ def get_link_fields(doctype):
# get link fields from tabCustom Field
custom_link_fields = frappe.db.sql("""\
select dt as parent, fieldname,
(select ifnull(issingle, 0) from tabDocType dt
(select issingle from tabDocType dt
where dt.name = df.dt) as issingle
from `tabCustom Field` df
where
@ -175,7 +175,7 @@ def get_link_fields(doctype):
# remove fields whose options have been changed using property setter
property_setter_link_fields = frappe.db.sql("""\
select ps.doc_type as parent, ps.field_name as fieldname,
(select ifnull(issingle, 0) from tabDocType dt
(select issingle from tabDocType dt
where dt.name = ps.doc_type) as issingle
from `tabProperty Setter` ps
where
@ -217,24 +217,24 @@ def get_select_fields(old, new):
# get link fields from tabDocField
select_fields = frappe.db.sql("""\
select parent, fieldname,
(select ifnull(issingle, 0) from tabDocType dt
(select issingle from tabDocType dt
where dt.name = df.parent) as issingle
from tabDocField df
where
df.parent != %s and df.fieldtype = 'Select' and
df.options like "%%%%%s%%%%" """ \
% ('%s', old), (new,), as_dict=1)
% ('%s', frappe.db.escape(old)), (new,), as_dict=1)
# get link fields from tabCustom Field
custom_select_fields = frappe.db.sql("""\
select dt as parent, fieldname,
(select ifnull(issingle, 0) from tabDocType dt
(select issingle from tabDocType dt
where dt.name = df.dt) as issingle
from `tabCustom Field` df
where
df.dt != %s and df.fieldtype = 'Select' and
df.options like "%%%%%s%%%%" """ \
% ('%s', old), (new,), as_dict=1)
% ('%s', frappe.db.escape(old)), (new,), as_dict=1)
# add custom link fields list to link fields list
select_fields += custom_select_fields
@ -242,7 +242,7 @@ def get_select_fields(old, new):
# remove fields whose options have been changed using property setter
property_setter_select_fields = frappe.db.sql("""\
select ps.doc_type as parent, ps.field_name as fieldname,
(select ifnull(issingle, 0) from tabDocType dt
(select issingle from tabDocType dt
where dt.name = ps.doc_type) as issingle
from `tabProperty Setter` ps
where
@ -250,7 +250,7 @@ def get_select_fields(old, new):
ps.property_type='options' and
ps.field_name is not null and
ps.value like "%%%%%s%%%%" """ \
% ('%s', old), (new,), as_dict=1)
% ('%s', frappe.db.escape(old)), (new,), as_dict=1)
select_fields += property_setter_select_fields
@ -262,14 +262,14 @@ def update_select_field_values(old, new):
where
parent != %s and fieldtype = 'Select' and
(options like "%%%%\\n%s%%%%" or options like "%%%%%s\\n%%%%")""" % \
('%s', '%s', '%s', old, old), (old, new, new))
('%s', '%s', '%s', frappe.db.escape(old), frappe.db.escape(old)), (old, new, new))
frappe.db.sql("""\
update `tabCustom Field` set options=replace(options, %s, %s)
where
dt != %s and fieldtype = 'Select' and
(options like "%%%%\\n%s%%%%" or options like "%%%%%s\\n%%%%")""" % \
('%s', '%s', '%s', old, old), (old, new, new))
('%s', '%s', '%s', frappe.db.escape(old), frappe.db.escape(old)), (old, new, new))
frappe.db.sql("""\
update `tabProperty Setter` set value=replace(value, %s, %s)
@ -277,7 +277,7 @@ def update_select_field_values(old, new):
doc_type != %s and field_name is not null and
property='options' and
(value like "%%%%\\n%s%%%%" or value like "%%%%%s\\n%%%%")""" % \
('%s', '%s', '%s', old, old), (old, new, new))
('%s', '%s', '%s', frappe.db.escape(old), frappe.db.escape(old)), (old, new, new))
def update_parenttype_values(old, new):
child_doctypes = frappe.db.sql("""\

View file

@ -17,6 +17,8 @@ execute:frappe.db.sql("alter table `tabSessions` modify `user` varchar(255), eng
execute:frappe.db.sql("delete from `tabDocField` where parent='0'")
frappe.patches.v4_0.change_varchar_length
frappe.patches.v6_4.reduce_varchar_length
frappe.patches.v5_2.change_checks_to_not_null
frappe.patches.v6_9.int_float_not_null
frappe.patches.v5_0.v4_to_v5
frappe.patches.v5_0.remove_shopping_cart_app
@ -88,7 +90,6 @@ frappe.patches.v5_0.modify_session
frappe.patches.v5_0.expire_old_scheduler_logs
execute:frappe.permissions.reset_perms("DocType")
execute:frappe.db.sql("delete from `tabProperty Setter` where `property` = 'idx'")
frappe.patches.v5_2.change_checks_to_not_null
frappe.patches.v5_3.rename_chinese_languages
frappe.patches.v6_0.communication_status_and_permission
frappe.patches.v6_0.make_task_log_folder
@ -104,3 +105,4 @@ execute:frappe.permissions.reset_perms("Web Page")
frappe.patches.v6_6.user_last_active
frappe.patches.v6_6.rename_slovak_language
frappe.patches.v6_6.fix_file_url
frappe.patches.v6_9.rename_burmese_language

View file

@ -5,7 +5,7 @@ from __future__ import unicode_literals
import frappe
def execute():
for dt in frappe.db.sql_list("""select name from `tabDocType` where ifnull(issingle, 0)=0"""):
for dt in frappe.db.sql_list("""select name from `tabDocType` where issingle=0"""):
desc = dict((d["Field"], d) for d in frappe.db.sql("desc `tab{}`".format(dt), as_dict=True))
alter_table = []

View file

@ -10,12 +10,12 @@ def execute():
table_columns = frappe.db.get_table_columns("DocPerm")
if "restricted" in table_columns:
frappe.db.sql("""update `tabDocPerm` set apply_user_permissions=1 where ifnull(apply_user_permissions, 0)=0
frappe.db.sql("""update `tabDocPerm` set apply_user_permissions=1 where apply_user_permissions=0
and restricted=1""")
if "match" in table_columns:
frappe.db.sql("""update `tabDocPerm` set apply_user_permissions=1
where ifnull(apply_user_permissions, 0)=0 and ifnull(`match`, '')!=''""")
where apply_user_permissions=0 and ifnull(`match`, '')!=''""")
# change Restriction to User Permission in tabDefaultValue
frappe.db.sql("""update `tabDefaultValue` set parenttype='User Permission' where parenttype='Restriction'""")

View file

View file

@ -0,0 +1,16 @@
from __future__ import unicode_literals
import frappe
def execute():
for doctype in frappe.get_all("DocType", filters={"issingle": 0}):
doctype = doctype.name
for column in frappe.db.sql("desc `tab{doctype}`".format(doctype=doctype), as_dict=True):
fieldname = column["Field"]
column_type = column["Type"]
if not (column_type.startswith("int") or column_type.startswith("decimal")):
continue
frappe.db.sql("""update `tab{doctype}` set `{fieldname}`=0 where `{fieldname}` is null"""\
.format(doctype=doctype, fieldname=fieldname))

View file

@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import frappe
from frappe.translate import rename_language
def execute():
rename_language("Melayu", "မြန်မာ")

View file

@ -19,6 +19,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Letter Head Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "letter_head_name",
"oldfieldtype": "Data",
@ -43,6 +44,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Disabled",
"length": 0,
"no_copy": 0,
"oldfieldname": "disabled",
"oldfieldtype": "Check",
@ -68,6 +70,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Is Default",
"length": 0,
"no_copy": 0,
"oldfieldname": "is_default",
"oldfieldtype": "Check",
@ -93,6 +96,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Content",
"length": 0,
"no_copy": 0,
"oldfieldname": "content",
"oldfieldtype": "Text Editor",
@ -116,7 +120,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 3,
"modified": "2015-10-02 07:38:56.001216",
"modified": "2015-11-16 06:29:49.706229",
"modified_by": "Administrator",
"module": "Print",
"name": "Letter Head",

View file

@ -20,6 +20,7 @@
"in_filter": 1,
"in_list_view": 1,
"label": "DocType",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Disabled",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -62,6 +64,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -83,7 +86,8 @@
"ignore_user_permissions": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Standard",
"label": "Standard",
"length": 0,
"no_copy": 1,
"oldfieldname": "standard",
"oldfieldtype": "Select",
@ -108,6 +112,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Custom Format",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -130,6 +135,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -153,7 +159,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Print Format Type",
"label": "Print Format Type",
"length": 0,
"no_copy": 0,
"options": "Server\nClient",
"permlevel": 0,
@ -177,6 +184,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "HTML",
"length": 0,
"no_copy": 0,
"oldfieldname": "html",
"oldfieldtype": "Text Editor",
@ -201,6 +209,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -224,6 +233,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Edit Format",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -245,6 +255,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -268,7 +279,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Font",
"label": "Font",
"length": 0,
"no_copy": 0,
"options": "Default\nArial\nHelvetica\nVerdana\nMonospace",
"permlevel": 0,
@ -291,6 +303,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -313,6 +326,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Custom CSS",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -335,6 +349,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Custom HTML Help",
"length": 0,
"no_copy": 0,
"options": "<h3>Custom CSS Help</h3>\n\n<p>Notes:</p>\n\n<ol>\n<li>All field groups (label + value) are set attributes <code>data-fieldtype</code> and <code>data-fieldname</code></li>\n<li>All values are given class <code>value</code></li>\n<li>All Section Breaks are given class <code>section-break</code></li>\n<li>All Column Breaks are given class <code>column-break</code></li>\n</ol>\n\n<h4>Examples</h4>\n\n<p>1. Left align integers</p>\n\n<pre><code>[data-fieldtype=\"Int\"] .value { text-left: left; }</code></pre>\n\n<p>1. Add border to sections except the last section</p>\n\n<pre><code>.section-break { padding: 30px 0px; border-bottom: 1px solid #eee; }\n.section-break:last-child { padding-bottom: 0px; border-bottom: 0px; }</code></pre>\n",
"permlevel": 0,
@ -358,6 +373,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -381,6 +397,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Print Format Help",
"length": 0,
"no_copy": 0,
"options": "<h3>Print Format Help</h3>\n<hr>\n<h4>Introduction</h4>\n<p>Print itemsFormats are rendered on the server side using the Jinja Templating Language. All forms have access to the <code>doc</code> object which contains information about the document that is being formatted. You can also access common utilities via the <code>frappe</code> module.</p>\n<p>For styling, the Boostrap CSS framework is provided and you can enjoy the full range of classes.</p>\n<hr>\n<h4>References</h4>\n<ol>\n\t<li><a href=\"http://jinja.pocoo.org/docs/templates/\" target=\"_blank\">Jinja Tempalting Language: Reference</a></li>\n\t<li><a href=\"http://getbootstrap.com\" target=\"_blank\">Bootstrap CSS Framework</a></li>\n</ol>\n<hr>\n<h4>Example</h4>\n<pre><code>&lt;h3&gt;{{ doc.select_print_heading or \"Invoice\" }}&lt;/h3&gt;\n&lt;div class=\"row\"&gt;\n\t&lt;div class=\"col-md-3 text-right\"&gt;Customer Name&lt;/div&gt;\n\t&lt;div class=\"col-md-9\"&gt;{{ doc.customer_name }}&lt;/div&gt;\n&lt;/div&gt;\n&lt;div class=\"row\"&gt;\n\t&lt;div class=\"col-md-3 text-right\"&gt;Date&lt;/div&gt;\n\t&lt;div class=\"col-md-9\"&gt;{{ doc.get_formatted(\"invoice_date\") }}&lt;/div&gt;\n&lt;/div&gt;\n&lt;table class=\"table table-bordered\"&gt;\n\t&lt;tbody&gt;\n\t\t&lt;tr&gt;\n\t\t\t&lt;th&gt;Sr&lt;/th&gt;\n\t\t\t&lt;th&gt;Item Name&lt;/th&gt;\n\t\t\t&lt;th&gt;Description&lt;/th&gt;\n\t\t\t&lt;th class=\"text-right\"&gt;Qty&lt;/th&gt;\n\t\t\t&lt;th class=\"text-right\"&gt;Rate&lt;/th&gt;\n\t\t\t&lt;th class=\"text-right\"&gt;Amount&lt;/th&gt;\n\t\t&lt;/tr&gt;\n\t\t{%- for row in doc.items -%}\n\t\t&lt;tr&gt;\n\t\t\t&lt;td style=\"width: 3%;\"&gt;{{ row.idx }}&lt;/td&gt;\n\t\t\t&lt;td style=\"width: 20%;\"&gt;\n\t\t\t\t{{ row.item_name }}\n\t\t\t\t{% if row.item_code != row.item_name -%}\n\t\t\t\t&lt;br&gt;Item Code: {{ row.item_code}}\n\t\t\t\t{%- endif %}\n\t\t\t&lt;/td&gt;\n\t\t\t&lt;td style=\"width: 37%;\"&gt;\n\t\t\t\t&lt;div style=\"border: 0px;\"&gt;{{ row.description }}&lt;/div&gt;&lt;/td&gt;\n\t\t\t&lt;td style=\"width: 10%; text-align: right;\"&gt;{{ row.qty }} {{ row.uom or row.stock_uom }}&lt;/td&gt;\n\t\t\t&lt;td style=\"width: 15%; text-align: right;\"&gt;{{\n\t\t\t\trow.get_formatted(\"rate\", doc) }}&lt;/td&gt;\n\t\t\t&lt;td style=\"width: 15%; text-align: right;\"&gt;{{\n\t\t\t\trow.get_formatted(\"amount\", doc) }}&lt;/td&gt;\n\t\t&lt;/tr&gt;\n\t\t{%- endfor -%}\n\t&lt;/tbody&gt;\n&lt;/table&gt;</code></pre>\n<hr>\n<h4>Common Functions</h4>\n<table class=\"table table-bordered\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td style=\"width: 30%\"><code>doc.get_formatted(\"[fieldname]\", [parent_doc])</code></td>\n\t\t\t<td>Get document value formatted as Date, Currency etc. Pass parent <code>doc</code> for curreny type fields.</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td style=\"width: 30%\"><code>frappe.db.get_value(\"[doctype]\", \"[name]\", \"fieldname\")</code></td>\n\t\t\t<td>Get value from another document.</td>\n\t\t</tr>\n\t</tbody>\n</table>\n",
"permlevel": 0,
@ -403,6 +420,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Format Data",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -425,6 +443,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Print Format Builder",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -447,7 +466,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2015-10-02 07:39:00.918464",
"modified": "2015-11-16 06:29:52.109293",
"modified_by": "Administrator",
"module": "Print",
"name": "Print Format",

View file

@ -876,15 +876,20 @@ frappe.ui.form.ControlAttachImage = frappe.ui.form.ControlAttach.extend({
this.img.on("click", function() { me.$input.click(); });
this.$wrapper.on("refresh", function() {
if(me.get_value()) {
$(me.input_area).find(".missing-image").toggle(false);
me.img.attr("src", me.dataurl ? me.dataurl : me.value).toggle(true);
} else {
$(me.input_area).find(".missing-image").toggle(true);
me.img.toggle(false);
}
me.set_image();
});
this.set_image();
},
set_image: function() {
if(this.get_value()) {
$(this.input_area).find(".missing-image").toggle(false);
this.img.attr("src", this.dataurl ? this.dataurl : this.value).toggle(true);
} else {
$(this.input_area).find(".missing-image").toggle(true);
this.img.toggle(false);
}
}
});

View file

@ -94,9 +94,9 @@ frappe.ui.form.AssignTo = Class.extend({
method: 'frappe.desk.form.assign_to.add',
doctype: me.frm.doctype,
docname: me.frm.docname,
callback: function(r) {
me.render(r.message);
me.frm.reload_doc();
callback: function(r) {
me.render(r.message);
me.frm.reload_doc();
}
});
}
@ -108,16 +108,27 @@ frappe.ui.form.AssignTo = Class.extend({
me.dialog.show();
me.dialog.get_input("myself").on("click", function() {
if($(this).prop("checked")) {
me.dialog.set_value("assign_to", user);
me.dialog.set_value("notify", 0);
} else {
me.dialog.set_value("assign_to", "");
me.dialog.set_value("notify", 1);
}
var myself = me.dialog.get_input("myself").on("click", function() {
me.toggle_myself(this);
});
me.toggle_myself(myself);
},
toggle_myself: function(myself) {
var me = this;
if($(myself).prop("checked")) {
me.dialog.set_value("assign_to", user);
me.dialog.set_value("notify", 0);
me.dialog.get_field("notify").$wrapper.toggle(false);
me.dialog.get_field("assign_to").$wrapper.toggle(false);
} else {
me.dialog.set_value("assign_to", "");
me.dialog.set_value("notify", 1);
me.dialog.get_field("notify").$wrapper.toggle(true);
me.dialog.get_field("assign_to").$wrapper.toggle(true);
}
},
remove: function(owner) {
var me = this;
@ -147,13 +158,16 @@ frappe.ui.to_do_dialog = function(opts){
title: __('Add to To Do'),
fields: [
{fieldtype:'Check', fieldname:'myself', label:__("Assign to me"), "default":0},
{fieldtype:'Link', fieldname:'assign_to', options:'User',
label:__("Assign To"),
description:__("Add to To Do List Of"), reqd:true},
{fieldtype:'Data', fieldname:'description', label:__("Comment"), reqd:true},
{fieldtype: 'Section Break'},
{fieldtype: 'Link', fieldname:'assign_to', options:'User',
label:__("Assign To"), reqd:true},
{fieldtype:'Small Text', fieldname:'description', label:__("Comment"), reqd:true},
{fieldtype: 'Section Break'},
{fieldtype: 'Column Break'},
{fieldtype:'Date', fieldname:'date', label: __("Complete By")},
{fieldtype:'Check', fieldname:'notify',
label:__("Notify by Email"), "default":1},
{fieldtype:'Date', fieldname:'date', label: __("Complete By")},
{fieldtype: 'Column Break'},
{fieldtype:'Select', fieldname:'priority', label: __("Priority"),
options:'Low\nMedium\nHigh', 'default':'Medium'},
],
@ -162,7 +176,7 @@ frappe.ui.to_do_dialog = function(opts){
});
dialog.fields_dict.assign_to.get_query = "frappe.core.doctype.user.user.user_query";
return dialog
}

View file

@ -90,7 +90,7 @@ frappe.ui.FieldGroup = frappe.ui.form.Layout.extend({
clear: function() {
for(key in this.fields_dict) {
var f = this.fields_dict[key];
if(f) {
if(f && f.set_input) {
f.set_input(f.df['default'] || '');
}
}

View file

@ -6,7 +6,7 @@
{% set controller = autodoc.get_controller(doctype) %}
<div class="dev-header">
{{ version(doctype) }}
{{ app.version or version(doctype) }}
{{ source_link(app, app.name + "/" + scrub(doc.module)
+ "/doctype/" + scrub(doctype), True) }}
</div>

View file

@ -1,10 +1,12 @@
<h3>{{ title }}</h3>
<p>{{_("Dear")}} {{ first_name }}{% if last_name %} {{ last_name}}{% endif %},</p>
<p>{{_("A new account has been created for you")}}.</p>
<p>{{_("A new account has been created for you at {0}").format(site_url)}}.</p>
<p>{{_("Your login id is")}}: <b>{{ user }}</b>
<p>{{_("Click on the link below to complete your registration and set a new password")}}.</p>
<p><b><a href="{{ link }}">{{_("Complete Registration")}}</a></b></p>
<br>
<p>{{_("You can also copy-paste this link in your browser")}} <a href="{{ link }}">{{ link }}</a></p>
<p>{{_("Thank you")}},<br>
{{ user_fullname }}</p>
<br>
<p style="font-size: 85%;">{{_("You can also copy-paste this link in your browser")}} <a href="{{ link }}">{{ link }}</a></p>

View file

@ -42,7 +42,7 @@ def add_comment(args=None):
# notify commentors
commentors = [d[0] for d in frappe.db.sql("""select comment_by from tabComment where
comment_doctype=%s and comment_docname=%s and
ifnull(unsubscribed, 0)=0""", (comment.comment_doctype, comment.comment_docname))]
unsubscribed=0""", (comment.comment_doctype, comment.comment_docname))]
owner = frappe.db.get_value(comment.comment_doctype, comment.comment_docname, "owner")
recipients = list(set(commentors if owner=="Administrator" else (commentors + [owner])))

View file

@ -317,6 +317,9 @@ def get_site_path(*path):
def get_files_path(*path):
return get_site_path("public", "files", *path)
def get_bench_path():
return os.path.realpath(os.path.join(os.path.dirname(frappe.__file__), '..', '..', '..'))
def get_backups_path():
return get_site_path("private", "backups")

View file

@ -148,8 +148,9 @@ def save_file(fname, content, dt, dn, folder=None, decode=False):
fname = get_file_name(fname, content_hash[-6:])
file_data = get_file_data_from_hash(content_hash)
if not file_data:
method = get_hook_method('write_file', fallback=save_file_on_filesystem)
call_hook_method("before_write_file", file_size=file_size)
method = get_hook_method('write_file', fallback=save_file_on_filesystem)
file_data = method(fname, content, content_type=content_type)
file_data = copy(file_data)

View file

@ -40,7 +40,8 @@ class setup_docs(object):
"docs_base_url": self.docs_config.docs_base_url,
"long_description": getattr(self.docs_config, "long_description", ""),
"license": self.hooks.get("app_license")[0],
"branch": getattr(self.docs_config, "branch", None) or "develop"
"branch": getattr(self.docs_config, "branch", None) or "develop",
"version": getattr(self.docs_config, "version", "")
}),
"get_doctype_app": frappe.get_doctype_app
}

View file

@ -18,6 +18,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Full Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -40,6 +41,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Image Link",
"length": 0,
"no_copy": 0,
"options": "",
"permlevel": 0,
@ -63,6 +65,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Bio",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -83,7 +86,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-10-19 03:04:52.537466",
"max_attachments": 0,
"modified": "2015-11-16 06:29:41.404549",
"modified_by": "Administrator",
"module": "Website",
"name": "About Us Team Member",

View file

@ -20,6 +20,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Category Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -41,6 +42,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Title",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -62,6 +64,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Published",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -84,6 +87,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Parent Website Route",
"length": 0,
"no_copy": 0,
"options": "",
"permlevel": 0,
@ -106,6 +110,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Page Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -126,7 +131,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-10-02 07:38:39.540340",
"max_attachments": 0,
"modified": "2015-11-16 06:29:42.454218",
"modified_by": "Administrator",
"module": "Website",
"name": "Blog Category",

View file

@ -18,6 +18,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Title",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -39,6 +40,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Published On",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -60,6 +62,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Published",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -80,6 +83,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -101,6 +105,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Blog Category",
"length": 0,
"no_copy": 0,
"options": "Blog Category",
"permlevel": 0,
@ -123,6 +128,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Blogger",
"length": 0,
"no_copy": 0,
"options": "Blogger",
"permlevel": 0,
@ -145,6 +151,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Parent Website Route",
"length": 0,
"no_copy": 0,
"options": "",
"permlevel": 0,
@ -166,6 +173,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -188,6 +196,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Blog Intro",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -209,6 +218,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Content",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -230,6 +240,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Page Name",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
@ -251,6 +262,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Email Sent",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -272,7 +284,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 5,
"modified": "2015-10-02 07:38:39.632512",
"modified": "2015-11-16 06:29:42.508658",
"modified_by": "Administrator",
"module": "Website",
"name": "Blog Post",

View file

@ -105,9 +105,9 @@ def get_list_context(context=None):
def get_children():
return frappe.db.sql("""select concat("blog/", page_name) as name,
title from `tabBlog Category`
where ifnull(published, 0) = 1
where published = 1
and exists (select name from `tabBlog Post`
where `tabBlog Post`.blog_category=`tabBlog Category`.name and ifnull(published, 0)=1)
where `tabBlog Post`.blog_category=`tabBlog Category`.name and published=1)
order by title asc""", as_dict=1)
def clear_blog_cache():

View file

@ -21,6 +21,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Disabled",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -43,6 +44,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Short Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -64,6 +66,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Full Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -85,6 +88,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "User",
"length": 0,
"no_copy": 0,
"options": "User",
"permlevel": 0,
@ -107,6 +111,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Bio",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -128,6 +133,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Avatar",
"length": 0,
"no_copy": 0,
"options": "",
"permlevel": 0,
@ -150,6 +156,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Posts",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -171,7 +178,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 1,
"modified": "2015-10-19 03:04:50.241951",
"modified": "2015-11-16 06:29:42.575954",
"modified_by": "Administrator",
"module": "Website",
"name": "Blogger",

View file

@ -18,6 +18,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Year",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -39,6 +40,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Highlight",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -60,7 +62,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-10-02 07:38:42.281395",
"max_attachments": 0,
"modified": "2015-11-16 06:29:43.720115",
"modified_by": "Administrator",
"module": "Website",
"name": "Company History",

View file

@ -18,6 +18,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Label",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -42,6 +43,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "Parent Label",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -64,6 +66,7 @@
"in_filter": 0,
"in_list_view": 1,
"label": "URL",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -87,7 +90,8 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Target",
"label": "Target",
"length": 0,
"no_copy": 0,
"options": "\ntarget = \"_blank\"",
"permlevel": 0,
@ -111,6 +115,7 @@
"in_filter": 0,
"in_list_view": 0,
"label": "Right",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@ -130,7 +135,8 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-10-02 07:39:17.448972",
"max_attachments": 0,
"modified": "2015-11-16 06:29:59.696074",
"modified_by": "Administrator",
"module": "Website",
"name": "Top Bar Item",

View file

@ -24,6 +24,7 @@ frappe.ui.form.on("Web Form", {
if(frm.doc.is_standard && !frappe.boot.developer_mode) {
frm.set_read_only();
frm.disable_save();
}
},
title: function(frm) {
@ -41,7 +42,7 @@ frappe.ui.form.on("Web Form", {
frappe.ui.form.on("Web Form Field", "fieldname", function(frm, doctype, name) {
var doc = frappe.get_doc(doctype, name);
df = $.map(frappe.get_doc("DocType", frm.doc.doc_type).fields, function(d) {
var df = $.map(frappe.get_doc("DocType", frm.doc.doc_type).fields, function(d) {
return doc.fieldname==d.fieldname ? d : null; })[0];
doc.label = df.label;

View file

@ -1,489 +1,509 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:title",
"creation": "2014-09-01 14:08:48.624556",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:title",
"creation": "2014-09-01 14:08:48.624556",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "title",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Title",
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "title",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Title",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Website URL",
"fieldname": "page_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Page Name",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Website URL",
"fieldname": "page_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Page Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "doc_type",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Select DocType",
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "doc_type",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Select DocType",
"length": 0,
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_4",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_4",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "is_standard",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Standard",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "is_standard",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Standard",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "published",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Published",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "published",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Published",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "login_required",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Login Required",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "login_required",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Login Required",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "login_required",
"fieldname": "allow_edit",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Allow Edit",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "login_required",
"fieldname": "allow_edit",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Allow Edit",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "login_required",
"fieldname": "allow_multiple",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Allow Multiple",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "login_required",
"fieldname": "allow_multiple",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Allow Multiple",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "allow_multiple",
"fieldname": "allow_delete",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Allow Delete",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "allow_multiple",
"fieldname": "allow_delete",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Allow Delete",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "login_required",
"fieldname": "allow_comments",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Allow Comments",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "login_required",
"fieldname": "allow_comments",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Allow Comments",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "fields",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Fields",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "fields",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Fields",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "introduction_text",
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Introduction",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "introduction_text",
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Introduction",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "web_form_fields",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Web Form Fields",
"no_copy": 0,
"options": "Web Form Field",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "web_form_fields",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Web Form Fields",
"length": 0,
"no_copy": 0,
"options": "Web Form Field",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "actions",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Actions",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "actions",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Actions",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Message to be displayed on successful completion",
"fieldname": "success_message",
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Success Message",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Message to be displayed on successful completion",
"fieldname": "success_message",
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Success Message",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Go to this url after completing the form.",
"fieldname": "success_url",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Success URL",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Go to this url after completing the form.",
"fieldname": "success_url",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Success URL",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "advanced",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Advanced",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "advanced",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Advanced",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Text to be displayed for Link to Web Page if this form has a web page. Link route will be automatically generated based on `page_name` and `parent_website_route`",
"fieldname": "web_page_link_text",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Web Page Link Text",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "Text to be displayed for Link to Web Page if this form has a web page. Link route will be automatically generated based on `page_name` and `parent_website_route`",
"fieldname": "web_page_link_text",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Web Page Link Text",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "In JSON as [{\"title\":\"Jobs\", \"name\":\"jobs\"}]",
"fieldname": "breadcrumbs",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Breadcrumbs",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"description": "In JSON as [{\"title\":\"Jobs\", \"name\":\"jobs\"}]",
"fieldname": "breadcrumbs",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Breadcrumbs",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-edit",
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-11-13 00:22:23.223163",
"modified_by": "Administrator",
"module": "Website",
"name": "Web Form",
"name_case": "",
"owner": "Administrator",
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "icon-edit",
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2015-11-16 06:30:00.321700",
"modified_by": "Administrator",
"module": "Website",
"name": "Web Form",
"name_case": "",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 1,
"role": "Website Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 1,
"role": "Website Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
}
],
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
],
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "title"
}
}

Some files were not shown because too many files have changed in this diff Show more