[fix][hr] fetch emp name in attendance and default value
This commit is contained in:
parent
10b112807c
commit
c0ebaae15a
@ -14,12 +14,11 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
cur_frm.add_fetch('employee', 'company', 'company');
|
||||
cur_frm.add_fetch('employee', 'company', 'company');
|
||||
cur_frm.add_fetch('employee', 'employee_name', 'employee_name');
|
||||
|
||||
//get employee's name based on employee id selected
|
||||
cur_frm.cscript.employee = function(doc,cdt,cdn){
|
||||
if(doc.employee) get_server_fields('get_emp_name', '', '', doc, cdt, cdn, 1);
|
||||
refresh_field('employee_name');
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
if(doc.__islocal) cur_frm.set_value("att_date", get_today());
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.employee.get_query = erpnext.utils.employee_query;
|
@ -26,12 +26,6 @@ class DocType:
|
||||
def __init__(self, doc, doclist=[]):
|
||||
self.doc = doc
|
||||
self.doclist = doclist
|
||||
|
||||
def get_emp_name(self):
|
||||
return {
|
||||
"employee_name": webnotes.conn.get_value("Employee",
|
||||
self.doc.employee_name, "employee_name")
|
||||
}
|
||||
|
||||
def validate_duplicate_record(self):
|
||||
res = sql("""select name from `tabAttendance` where employee = %s and att_date = %s
|
||||
|
@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-10 16:34:13",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-07-05 14:25:19",
|
||||
"modified": "2013-07-10 17:39:22",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "ashwini@webnotestech.com"
|
||||
},
|
||||
@ -25,6 +25,7 @@
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"name": "__common__",
|
||||
@ -33,6 +34,8 @@
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"submit": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
@ -80,6 +83,7 @@
|
||||
"oldfieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"default": "Present",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
@ -157,15 +161,15 @@
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"cancel": 1,
|
||||
"doctype": "DocPerm",
|
||||
"report": 1,
|
||||
"role": "HR User",
|
||||
"submit": 1
|
||||
"role": "System Manager"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"match": "owner",
|
||||
"role": "Employee"
|
||||
"role": "HR User"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "HR Manager"
|
||||
}
|
||||
]
|
@ -23,9 +23,14 @@ wn.module_page["HR"] = [
|
||||
doctype:"Expense Claim"
|
||||
},
|
||||
{
|
||||
label: wn._("Job Applicant"),
|
||||
description: wn._("Applicant for a Job."),
|
||||
doctype:"Job Applicant"
|
||||
label: wn._("Salary Slip"),
|
||||
description: wn._("Monthly salary statement."),
|
||||
doctype:"Salary Slip"
|
||||
},
|
||||
{
|
||||
label: wn._("Attendance"),
|
||||
description: wn._("Attendance record."),
|
||||
doctype:"Attendance"
|
||||
},
|
||||
]
|
||||
},
|
||||
@ -34,14 +39,9 @@ wn.module_page["HR"] = [
|
||||
icon: "icon-copy",
|
||||
items: [
|
||||
{
|
||||
label: wn._("Attendance"),
|
||||
description: wn._("Attendance record."),
|
||||
doctype:"Attendance"
|
||||
},
|
||||
{
|
||||
label: wn._("Salary Slip"),
|
||||
description: wn._("Monthly salary statement."),
|
||||
doctype:"Salary Slip"
|
||||
label: wn._("Job Applicant"),
|
||||
description: wn._("Applicant for a Job."),
|
||||
doctype:"Job Applicant"
|
||||
},
|
||||
{
|
||||
label: wn._("Appraisal"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user