|
@@ -44,9 +44,6 @@ def insert(doclist): |
|
|
def save(doclist): |
|
|
def save(doclist): |
|
|
if isinstance(doclist, basestring): |
|
|
if isinstance(doclist, basestring): |
|
|
doclist = json.loads(doclist) |
|
|
doclist = json.loads(doclist) |
|
|
|
|
|
|
|
|
if not webnotes.has_permission(doclist[0]["doctype"], "write"): |
|
|
|
|
|
webnotes.msgprint("No Write Permission", raise_exception=True) |
|
|
|
|
|
|
|
|
|
|
|
doclistobj = webnotes.model_wrapper(doclist) |
|
|
doclistobj = webnotes.model_wrapper(doclist) |
|
|
doclistobj.save() |
|
|
doclistobj.save() |
|
@@ -57,15 +54,19 @@ def save(doclist): |
|
|
def submit(doclist): |
|
|
def submit(doclist): |
|
|
if isinstance(doclist, basestring): |
|
|
if isinstance(doclist, basestring): |
|
|
doclist = json.loads(doclist) |
|
|
doclist = json.loads(doclist) |
|
|
|
|
|
|
|
|
if not webnotes.has_permission(doclist[0]["doctype"], "submit"): |
|
|
|
|
|
webnotes.msgprint("No Submit Permission", raise_exception=True) |
|
|
|
|
|
|
|
|
|
|
|
doclistobj = webnotes.model_wrapper(doclist) |
|
|
doclistobj = webnotes.model_wrapper(doclist) |
|
|
doclistobj.submit() |
|
|
doclistobj.submit() |
|
|
|
|
|
|
|
|
return [d.fields for d in doclist] |
|
|
return [d.fields for d in doclist] |
|
|
|
|
|
|
|
|
|
|
|
@webnotes.whitelist() |
|
|
|
|
|
def cancel(doctype, name): |
|
|
|
|
|
wrapper = webnotes.model_wrapper(doctype, name) |
|
|
|
|
|
wrapper.cancel() |
|
|
|
|
|
|
|
|
|
|
|
return [d.fields for d in wrapper.doclist] |
|
|
|
|
|
|
|
|
@webnotes.whitelist() |
|
|
@webnotes.whitelist() |
|
|
def set_default(key, value, parent=None): |
|
|
def set_default(key, value, parent=None): |
|
|
"""set a user default value""" |
|
|
"""set a user default value""" |
|
|