[minor] [fix] employee field while new sales person created from tree
This commit is contained in:
parent
50f5fd13c7
commit
d351318014
@ -123,15 +123,23 @@ erpnext.SalesChart = Class.extend({
|
|||||||
new_node: function() {
|
new_node: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
var fields = [
|
||||||
|
{fieldtype:'Data', fieldname: 'name_field',
|
||||||
|
label:'New ' + me.ctype + ' Name', reqd:true},
|
||||||
|
{fieldtype:'Select', fieldname:'is_group', label:'Group Node', options:'No\nYes',
|
||||||
|
description: "Further nodes can be only created under 'Group' type nodes"},
|
||||||
|
{fieldtype:'Button', fieldname:'create_new', label:'Create New' }
|
||||||
|
]
|
||||||
|
|
||||||
|
if(me.ctype == "Sales Person") {
|
||||||
|
fields.splice(-1, 0, {fieldtype:'Link', fieldname:'employee', label:'Employee',
|
||||||
|
options:'Employee', description: "Please enter Employee Id of this sales parson"});
|
||||||
|
}
|
||||||
|
|
||||||
// the dialog
|
// the dialog
|
||||||
var d = new wn.ui.Dialog({
|
var d = new wn.ui.Dialog({
|
||||||
title:'New ' + me.ctype,
|
title:'New ' + me.ctype,
|
||||||
fields: [
|
fields: fields
|
||||||
{fieldtype:'Data', fieldname: 'name_field', label:'New ' + me.ctype + ' Name', reqd:true},
|
|
||||||
{fieldtype:'Select', fieldname:'is_group', label:'Group Node',
|
|
||||||
options:'No\nYes', description: "Further nodes can be only created under 'Group' type nodes"},
|
|
||||||
{fieldtype:'Button', fieldname:'create_new', label:'Create New' }
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
d.set_value("is_group", "No");
|
d.set_value("is_group", "No");
|
||||||
|
@ -30,4 +30,7 @@ def add_node():
|
|||||||
parent_field: webnotes.form_dict['parent'],
|
parent_field: webnotes.form_dict['parent'],
|
||||||
"is_group": webnotes.form_dict['is_group']
|
"is_group": webnotes.form_dict['is_group']
|
||||||
}]
|
}]
|
||||||
|
if ctype == "Sales Person":
|
||||||
|
doclist[0]["employee"] = webnotes.form_dict.get('employee')
|
||||||
|
|
||||||
webnotes.bean(doclist).save()
|
webnotes.bean(doclist).save()
|
Loading…
x
Reference in New Issue
Block a user