[fixes] assignment should work witout saving documents (#3163)
* [fixes] assignment should work witout saving documents * [minor] check if document is __local before assignement
This commit is contained in:
parent
14c4796e05
commit
3581ad8db7
2 changed files with 3 additions and 8 deletions
|
|
@ -66,10 +66,7 @@ def add(args=None):
|
|||
notify_assignment(d.assigned_by, d.owner, d.reference_type, d.reference_name, action='ASSIGN',\
|
||||
description=args.get("description"), notify=args.get('notify'))
|
||||
|
||||
if not args.get("bulk_assign"):
|
||||
return get(args)
|
||||
else:
|
||||
return {}
|
||||
return get(args)
|
||||
|
||||
@frappe.whitelist()
|
||||
def add_multiple(args=None):
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ frappe.ui.form.AssignTo = Class.extend({
|
|||
add: function() {
|
||||
var me = this;
|
||||
|
||||
if(this.frm.doc.__unsaved == 1) {
|
||||
if(this.frm.is_new()) {
|
||||
frappe.throw(__("Please save the document before assignment"));
|
||||
return;
|
||||
}
|
||||
|
|
@ -93,7 +93,6 @@ frappe.ui.form.AssignTo = Class.extend({
|
|||
docname: me.frm.docname,
|
||||
callback: function(r) {
|
||||
me.render(r.message);
|
||||
me.frm.reload_doc();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -108,7 +107,7 @@ frappe.ui.form.AssignTo = Class.extend({
|
|||
remove: function(owner) {
|
||||
var me = this;
|
||||
|
||||
if(this.frm.doc.__unsaved == 1) {
|
||||
if(this.frm.is_new()) {
|
||||
frappe.throw(__("Please save the document before removing assignment"));
|
||||
return;
|
||||
}
|
||||
|
|
@ -122,7 +121,6 @@ frappe.ui.form.AssignTo = Class.extend({
|
|||
},
|
||||
callback:function(r,rt) {
|
||||
me.render(r.message);
|
||||
me.frm.reload_doc();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue