@@ -460,12 +460,13 @@ def clear_cache(user=None, doctype=None): | |||||
frappe.sessions.clear_cache() | frappe.sessions.clear_cache() | ||||
translate.clear_cache() | translate.clear_cache() | ||||
reset_metadata_version() | reset_metadata_version() | ||||
frappe.local.cache = {} | |||||
local.cache = {} | |||||
local.new_doc_templates = {} | |||||
for fn in frappe.get_hooks("clear_cache"): | |||||
for fn in get_hooks("clear_cache"): | |||||
get_attr(fn)() | get_attr(fn)() | ||||
frappe.local.role_permissions = {} | |||||
local.role_permissions = {} | |||||
def has_permission(doctype=None, ptype="read", doc=None, user=None, verbose=False, throw=False): | def has_permission(doctype=None, ptype="read", doc=None, user=None, verbose=False, throw=False): | ||||
"""Raises `frappe.PermissionError` if not permitted. | """Raises `frappe.PermissionError` if not permitted. | ||||
@@ -1,6 +1,6 @@ | |||||
from __future__ import unicode_literals, absolute_import | from __future__ import unicode_literals, absolute_import | ||||
import click | import click | ||||
import hashlib, os | |||||
import hashlib, os, sys | |||||
import frappe | import frappe | ||||
from frappe.commands import pass_context, get_site | from frappe.commands import pass_context, get_site | ||||
from frappe.commands.scheduler import _is_scheduler_enabled | from frappe.commands.scheduler import _is_scheduler_enabled | ||||
@@ -83,6 +83,13 @@ def restore(context, sql_file_path, mariadb_root_username=None, mariadb_root_pas | |||||
"Restore site database from an sql file" | "Restore site database from an sql file" | ||||
from frappe.installer import extract_sql_gzip, extract_tar_files | from frappe.installer import extract_sql_gzip, extract_tar_files | ||||
# Extract the gzip file if user has passed *.sql.gz file instead of *.sql file | # Extract the gzip file if user has passed *.sql.gz file instead of *.sql file | ||||
if not os.path.exists(sql_file_path): | |||||
sql_file_path = '../' + sql_file_path | |||||
if not os.path.exists(sql_file_path): | |||||
print 'Invalid path {0}' + sql_file_path[3:] | |||||
sys.exit(1) | |||||
if sql_file_path.endswith('sql.gz'): | if sql_file_path.endswith('sql.gz'): | ||||
sql_file_path = extract_sql_gzip(os.path.abspath(sql_file_path)) | sql_file_path = extract_sql_gzip(os.path.abspath(sql_file_path)) | ||||
@@ -319,6 +319,11 @@ a.form-link { | |||||
textarea.form-control { | textarea.form-control { | ||||
height: 120px; | height: 120px; | ||||
} | } | ||||
.form-control[disabled], | |||||
.form-control[readonly], | |||||
fieldset[disabled] .form-control { | |||||
background-color: #fafbfc; | |||||
} | |||||
.link-select-row { | .link-select-row { | ||||
padding: 5px; | padding: 5px; | ||||
border-bottom: 1px solid #EBEFF2; | border-bottom: 1px solid #EBEFF2; | ||||
@@ -108,11 +108,6 @@ | |||||
.grid-body .editable-row .has-error .form-control:focus { | .grid-body .editable-row .has-error .form-control:focus { | ||||
border-color: #ff5858; | border-color: #ff5858; | ||||
} | } | ||||
.grid-body .editable-row .form-control[disabled], | |||||
.grid-body .editable-row .form-control[readonly], | |||||
.grid-body .editable-row fieldset[disabled] .form-control { | |||||
background-color: #fafbfc; | |||||
} | |||||
.grid-body .editable-row input[data-fieldtype="Int"], | .grid-body .editable-row input[data-fieldtype="Int"], | ||||
.grid-body .editable-row input[data-fieldtype="Float"], | .grid-body .editable-row input[data-fieldtype="Float"], | ||||
.grid-body .editable-row input[data-fieldtype="Currency"] { | .grid-body .editable-row input[data-fieldtype="Currency"] { | ||||
@@ -93,7 +93,10 @@ frappe.msgprint = function(msg, title) { | |||||
} | } | ||||
if(data.message instanceof Array) { | if(data.message instanceof Array) { | ||||
data.message = $.map(data.message, function(m) { return '<p>' + m + '</p>'}).join(''); | |||||
data.message.forEach(function(m) { | |||||
frappe.msgprint(m); | |||||
}); | |||||
return; | |||||
} | } | ||||
if(data.alert) { | if(data.alert) { | ||||
@@ -365,7 +365,7 @@ _f.Frm.prototype.show_web_link = function() { | |||||
if(!doc.__islocal && doc.__onload && doc.__onload.is_website_generator) { | if(!doc.__islocal && doc.__onload && doc.__onload.is_website_generator) { | ||||
me.web_link && me.web_link.remove(); | me.web_link && me.web_link.remove(); | ||||
if(doc.__onload.published) { | if(doc.__onload.published) { | ||||
me.add_web_link("/" + doc.__onload.website_route) | |||||
me.add_web_link("/" + doc.route) | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -121,6 +121,11 @@ textarea.form-control { | |||||
height: 120px; | height: 120px; | ||||
} | } | ||||
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { | |||||
background-color: @light-bg; | |||||
} | |||||
.link-select-row { | .link-select-row { | ||||
padding: 5px; | padding: 5px; | ||||
border-bottom: 1px solid @light-border-color; | border-bottom: 1px solid @light-border-color; | ||||
@@ -134,10 +134,6 @@ | |||||
} | } | ||||
} | } | ||||
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { | |||||
background-color: @light-bg; | |||||
} | |||||
input[data-fieldtype="Int"], input[data-fieldtype="Float"], input[data-fieldtype="Currency"] { | input[data-fieldtype="Int"], input[data-fieldtype="Float"], input[data-fieldtype="Currency"] { | ||||
text-align: right; | text-align: right; | ||||
} | } | ||||
@@ -176,7 +176,10 @@ def get_time(time_str): | |||||
return time_str.time() | return time_str.time() | ||||
elif isinstance(time_str, datetime.time): | elif isinstance(time_str, datetime.time): | ||||
return time_str | return time_str | ||||
return parser.parse(time_str).time() | |||||
else: | |||||
if isinstance(time_str, datetime.timedelta): | |||||
time_str = str(time_str) | |||||
return parser.parse(time_str).time() | |||||
def get_datetime_str(datetime_obj): | def get_datetime_str(datetime_obj): | ||||
if isinstance(datetime_obj, basestring): | if isinstance(datetime_obj, basestring): | ||||
@@ -9,6 +9,7 @@ | |||||
"docstatus": 0, | "docstatus": 0, | ||||
"doctype": "DocType", | "doctype": "DocType", | ||||
"document_type": "Document", | "document_type": "Document", | ||||
"editable_grid": 0, | |||||
"fields": [ | "fields": [ | ||||
{ | { | ||||
"allow_on_submit": 0, | "allow_on_submit": 0, | ||||
@@ -158,7 +159,7 @@ | |||||
"reqd": 0, | "reqd": 0, | ||||
"search_index": 0, | "search_index": 0, | ||||
"set_only_once": 0, | "set_only_once": 0, | ||||
"unique": 0 | |||||
"unique": 1 | |||||
}, | }, | ||||
{ | { | ||||
"allow_on_submit": 0, | "allow_on_submit": 0, | ||||
@@ -617,7 +618,7 @@ | |||||
"issingle": 0, | "issingle": 0, | ||||
"istable": 0, | "istable": 0, | ||||
"max_attachments": 20, | "max_attachments": 20, | ||||
"modified": "2016-06-23 12:29:31.442059", | |||||
"modified": "2016-07-08 06:22:38.925289", | |||||
"modified_by": "Administrator", | "modified_by": "Administrator", | ||||
"module": "Website", | "module": "Website", | ||||
"name": "Web Page", | "name": "Web Page", | ||||