[fix][hr] fetch emp name in attendance and default value
diff --git a/hr/doctype/attendance/attendance.js b/hr/doctype/attendance/attendance.js
index 3ba9868..1749a6c 100644
--- a/hr/doctype/attendance/attendance.js
+++ b/hr/doctype/attendance/attendance.js
@@ -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;
\ No newline at end of file
diff --git a/hr/doctype/attendance/attendance.py b/hr/doctype/attendance/attendance.py
index ac41acf..16e2547 100644
--- a/hr/doctype/attendance/attendance.py
+++ b/hr/doctype/attendance/attendance.py
@@ -26,12 +26,6 @@
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
diff --git a/hr/doctype/attendance/attendance.txt b/hr/doctype/attendance/attendance.txt
index aa917ed..d948d6f 100644
--- a/hr/doctype/attendance/attendance.txt
+++ b/hr/doctype/attendance/attendance.txt
@@ -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"
}
]
\ No newline at end of file
diff --git a/hr/page/hr_home/hr_home.js b/hr/page/hr_home/hr_home.js
index 517fb77..dadc6fb 100644
--- a/hr/page/hr_home/hr_home.js
+++ b/hr/page/hr_home/hr_home.js
@@ -23,9 +23,14 @@
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 @@
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"),