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