diff --git a/home/page/latest_updates/latest_updates.js b/home/page/latest_updates/latest_updates.js index 24544c51ed..c59c5b9180 100644 --- a/home/page/latest_updates/latest_updates.js +++ b/home/page/latest_updates/latest_updates.js @@ -1,5 +1,6 @@ erpnext.updates = [ ["14th November 2012", [ + "Employee: If User ID is set, Employee Name will be updated in defaults and will appear automatically in all relevant forms.", "Backups: Link to download both database and files.", ]], ["13th November 2012", [ diff --git a/hr/doctype/employee/employee.js b/hr/doctype/employee/employee.js index c69607193c..769e5b6d5d 100644 --- a/hr/doctype/employee/employee.js +++ b/hr/doctype/employee/employee.js @@ -8,60 +8,59 @@ // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . + +cur_frm.cscript.onload = function(doc) { + // bc + var india_specific = ["esic_card_no", "gratuity_lic_id", "pan_number", "pf_number"] + if(wn.control_panel.country!="India") { + hide_field(india_specific); + } +} + +cur_frm.cscript.refresh = function(doc) { + if(!doc.__islocal) { + hide_field("naming_series"); + cur_frm.add_custom_button('Make Salary Structure', cur_frm.cscript['Make Salary Structure']); + } +} -// get retirement date -//======================================================== cur_frm.cscript.date_of_birth = function(doc, dt, dn) { - get_server_fields('get_retirement_date','','',doc,dt,dn,1); + get_server_fields('get_retirement_date','','',doc,dt,dn,1); } -// salutation-gender -//======================================================== cur_frm.cscript.salutation = function(doc,dt,dn) { - if(doc.salutation){ - if(doc.salutation=='Mr') - doc.gender='Male'; - else if(doc.salutation=='Ms') - doc.gender='Female'; - refresh_field('gender'); - } + if(doc.salutation){ + if(doc.salutation=='Mr') + doc.gender='Male'; + else if(doc.salutation=='Ms') + doc.gender='Female'; + refresh_field('gender'); + } } -// On refresh -//======================================================== -cur_frm.cscript.refresh = function(doc, dt, dn) { - if(doc.__islocal!=1){ - cur_frm.add_custom_button('Make Salary Structure', cur_frm.cscript['Make Salary Structure']); - } -} - -//Make Salary Structure -//======================================================== cur_frm.cscript['Make Salary Structure']=function(){ - $c_obj(make_doclist (doc.doctype,doc.name),'check_sal_structure',cur_frm.doc.name,function(r, rt) { - if(r.message) - alert("You have already created Active salary structure.\nIf you want to create new one, please ensure that no active salary structure exist.\nTo inactive salary structure select 'Is Active' as 'No'."); - else - cur_frm.cscript.make_salary_structure(cur_frm.doc); - }); + $c_obj(make_doclist (doc.doctype,doc.name),'check_sal_structure',cur_frm.doc.name,function(r, rt) { + if(r.message) + alert("You have already created Active salary structure.\nIf you want to create new one, please ensure that no active salary structure exist.\nTo inactive salary structure select 'Is Active' as 'No'."); + else + cur_frm.cscript.make_salary_structure(cur_frm.doc); + }); } -// Load sal structure -//======================================================== cur_frm.cscript.make_salary_structure = function(doc,dt,dn,det){ - var st = LocalDB.create('Salary Structure'); - st = locals['Salary Structure'][st]; - st.employee = doc.name; - st.employee_name = doc.employee_name; - st.branch=doc.branch; - st.designation=doc.designation; - st.department=doc.department; - st.fiscal_year = doc.fiscal_year - st.grade=doc.grade; - loaddoc('Salary Structure', st.name); + var st = LocalDB.create('Salary Structure'); + st = locals['Salary Structure'][st]; + st.employee = doc.name; + st.employee_name = doc.employee_name; + st.branch=doc.branch; + st.designation=doc.designation; + st.department=doc.department; + st.fiscal_year = doc.fiscal_year + st.grade=doc.grade; + loaddoc('Salary Structure', st.name); } diff --git a/hr/doctype/employee/employee.py b/hr/doctype/employee/employee.py index 26681dd185..0be68306f1 100644 --- a/hr/doctype/employee/employee.py +++ b/hr/doctype/employee/employee.py @@ -8,128 +8,112 @@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . from __future__ import unicode_literals import webnotes -from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add -from webnotes.model import db_exists -from webnotes.model.doc import Document, addchild, getchildren, make_autoname -from webnotes.model.doclist import getlist, copy_doclist -from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax -from webnotes import session, form, msgprint, errprint +from webnotes.utils import getdate, now, nowdate, validate_email_add +from webnotes.model.doc import make_autoname +from webnotes import msgprint sql = webnotes.conn.sql -get_value = webnotes.conn.get_value -in_transaction = webnotes.conn.in_transaction -convert_to_lists = webnotes.conn.convert_to_lists - -# ----------------------------------------------------------------------------------------- - class DocType: - def __init__(self,doc,doclist=[]): - self.doc = doc - self.doclist = doclist + def __init__(self,doc,doclist=[]): + self.doc = doc + self.doclist = doclist - # Autoname - #======================================================================================================== - def autoname(self): - ret = sql("select value from `tabSingles` where doctype = 'Global Defaults' and field = 'emp_created_by'") - if not ret: - msgprint("To Save Employee, please go to Setup -->Global Defaults. Click on HR and select 'Employee Records to be created by'.") - raise Exception - else: - if ret[0][0]=='Naming Series': - self.doc.name = make_autoname(self.doc.naming_series + '.####') - elif ret[0][0]=='Employee Number': - self.doc.name = make_autoname(self.doc.employee_number) - - # Get retirement date - #======================================================================================================== - def get_retirement_date(self): - import datetime - ret = {} - if self.doc.date_of_birth: - dt = getdate(self.doc.date_of_birth) + datetime.timedelta(21915) - ret = {'date_of_retirement': dt.strftime('%Y-%m-%d')} - return ret + def autoname(self): + ret = sql("select value from `tabSingles` where doctype = 'Global Defaults' and field = 'emp_created_by'") + if not ret: + msgprint("Please setup Employee Naming System in Setup > Global Defaults > HR", raise_exception=True) + else: + if ret[0][0]=='Naming Series': + self.doc.name = make_autoname(self.doc.naming_series + '.####') + elif ret[0][0]=='Employee Number': + self.doc.name = make_autoname(self.doc.employee_number) + + def get_retirement_date(self): + import datetime + ret = {} + if self.doc.date_of_birth: + dt = getdate(self.doc.date_of_birth) + datetime.timedelta(21915) + ret = {'date_of_retirement': dt.strftime('%Y-%m-%d')} + return ret - # check if salary structure exists - #======================================================================================================== - def check_sal_structure(self, nm): - ret_sal_struct=sql("select name from `tabSalary Structure` where employee='%s' and is_active = 'Yes' and docstatus!= 2"%nm) - return ret_sal_struct and ret_sal_struct[0][0] or '' + def check_sal_structure(self, nm): + ret_sal_struct=sql("select name from `tabSalary Structure` where employee='%s' and is_active = 'Yes' and docstatus!= 2"%nm) + return ret_sal_struct and ret_sal_struct[0][0] or '' - #======================================================================================================== - def validate(self): - self.validate_date() - self.validate_email() - self.validate_name() - self.validate_status() - - # Validate dates - #======================================================================================================== - def validate_date(self): - import datetime - if self.doc.date_of_birth and self.doc.date_of_joining and getdate(self.doc.date_of_birth) >= getdate(self.doc.date_of_joining): - msgprint('Date of Joining must be greater than Date of Birth') - raise Exception + def validate(self): + self.validate_date() + self.validate_email() + self.validate_name() + self.validate_status() + + def on_update(self): + self.update_user_default() + + def update_user_default(self): + if self.doc.user_id: + webnotes.conn.set_default("employee", self.doc.name, self.doc.user_id) + webnotes.conn.set_default("employee_name", self.doc.employee_name, self.doc.user_id) + webnotes.conn.set_default("company", self.doc.company, self.doc.user_id) + + def validate_date(self): + import datetime + if self.doc.date_of_birth and self.doc.date_of_joining and getdate(self.doc.date_of_birth) >= getdate(self.doc.date_of_joining): + msgprint('Date of Joining must be greater than Date of Birth') + raise Exception - elif self.doc.scheduled_confirmation_date and self.doc.date_of_joining and (getdate(self.doc.scheduled_confirmation_date) < getdate(self.doc.date_of_joining)): - msgprint('Scheduled Confirmation Date must be greater than Date of Joining') - raise Exception - - elif self.doc.final_confirmation_date and self.doc.date_of_joining and (getdate(self.doc.final_confirmation_date) < getdate(self.doc.date_of_joining)): - msgprint('Final Confirmation Date must be greater than Date of Joining') - raise Exception - - elif self.doc.date_of_retirement and self.doc.date_of_joining and (getdate(self.doc.date_of_retirement) <= getdate(self.doc.date_of_joining)): - msgprint('Date Of Retirement must be greater than Date of Joining') - raise Exception - - elif self.doc.relieving_date and self.doc.date_of_joining and (getdate(self.doc.relieving_date) <= getdate(self.doc.date_of_joining)): - msgprint('Relieving Date must be greater than Date of Joining') - raise Exception - - elif self.doc.contract_end_date and self.doc.date_of_joining and (getdate(self.doc.contract_end_date)<=getdate(self.doc.date_of_joining)): - msgprint('Contract End Date must be greater than Date of Joining') - raise Exception - - # Validate email id - #======================================================================================================== - def validate_email(self): - if self.doc.company_email and not validate_email_add(self.doc.company_email): - msgprint("Please enter valid Company Email") - raise Exception - if self.doc.personal_email and not validate_email_add(self.doc.personal_email): - msgprint("Please enter valid Personal Email") - raise Exception + elif self.doc.scheduled_confirmation_date and self.doc.date_of_joining and (getdate(self.doc.scheduled_confirmation_date) < getdate(self.doc.date_of_joining)): + msgprint('Scheduled Confirmation Date must be greater than Date of Joining') + raise Exception + + elif self.doc.final_confirmation_date and self.doc.date_of_joining and (getdate(self.doc.final_confirmation_date) < getdate(self.doc.date_of_joining)): + msgprint('Final Confirmation Date must be greater than Date of Joining') + raise Exception + + elif self.doc.date_of_retirement and self.doc.date_of_joining and (getdate(self.doc.date_of_retirement) <= getdate(self.doc.date_of_joining)): + msgprint('Date Of Retirement must be greater than Date of Joining') + raise Exception + + elif self.doc.relieving_date and self.doc.date_of_joining and (getdate(self.doc.relieving_date) <= getdate(self.doc.date_of_joining)): + msgprint('Relieving Date must be greater than Date of Joining') + raise Exception + + elif self.doc.contract_end_date and self.doc.date_of_joining and (getdate(self.doc.contract_end_date)<=getdate(self.doc.date_of_joining)): + msgprint('Contract End Date must be greater than Date of Joining') + raise Exception + + def validate_email(self): + if self.doc.company_email and not validate_email_add(self.doc.company_email): + msgprint("Please enter valid Company Email") + raise Exception + if self.doc.personal_email and not validate_email_add(self.doc.personal_email): + msgprint("Please enter valid Personal Email") + raise Exception - # Validate name - #======================================================================================================== - def validate_name(self): - ret = sql("select value from `tabSingles` where doctype = 'Global Defaults' and field = 'emp_created_by'") + def validate_name(self): + ret = sql("select value from `tabSingles` where doctype = 'Global Defaults' and field = 'emp_created_by'") - if not ret: - msgprint("To Save Employee, please go to Setup -->Global Defaults. Click on HR and select 'Employee Records to be created by'.") - raise Exception - else: - if ret[0][0]=='Naming Series' and not self.doc.naming_series: - msgprint("Please select Naming Series.") - raise Exception - elif ret[0][0]=='Employee Number' and not self.doc.employee_number: - msgprint("Please enter Employee Number.") - raise Exception - - # Validate status - #======================================================================================================== - def validate_status(self): - if self.doc.status == 'Left' and not self.doc.relieving_date: - msgprint("Please enter relieving date.") - raise Exception + if not ret: + msgprint("To Save Employee, please go to Setup -->Global Defaults. Click on HR and select 'Employee Records to be created by'.") + raise Exception + else: + if ret[0][0]=='Naming Series' and not self.doc.naming_series: + msgprint("Please select Naming Series.") + raise Exception + elif ret[0][0]=='Employee Number' and not self.doc.employee_number: + msgprint("Please enter Employee Number.") + raise Exception + + def validate_status(self): + if self.doc.status == 'Left' and not self.doc.relieving_date: + msgprint("Please enter relieving date.") + raise Exception diff --git a/hr/doctype/employee/employee.txt b/hr/doctype/employee/employee.txt index d9e2c1fb38..d7eab4aaa0 100644 --- a/hr/doctype/employee/employee.txt +++ b/hr/doctype/employee/employee.txt @@ -3,11 +3,11 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:35:55', - 'docstatus': 0, - 'modified': '2012-03-27 14:35:55', - 'modified_by': u'Administrator', - 'owner': u'Administrator' + u'creation': '2012-07-03 13:30:40', + u'docstatus': 0, + u'modified': '2012-11-14 16:12:10', + u'modified_by': u'Administrator', + u'owner': u'Administrator' }, # These values are common for all DocType @@ -16,23 +16,23 @@ 'allow_attach': 1, 'allow_trash': 1, 'colour': u'White:FFF', - 'doctype': 'DocType', + u'doctype': u'DocType', 'document_type': u'Master', 'module': u'HR', - 'name': '__common__', + u'name': u'__common__', 'search_fields': u'employee_name', 'section_style': u'Tabbed', 'server_code_error': u' ', 'show_in_menu': 0, 'subject': u'%(employee_name)s', 'tag_fields': u'status', - 'version': 444 + 'version': 1 }, # These values are common for all DocField { - 'doctype': u'DocField', - 'name': '__common__', + u'doctype': u'DocField', + u'name': u'__common__', 'parent': u'Employee', 'parentfield': u'fields', 'parenttype': u'DocType' @@ -40,8 +40,8 @@ # These values are common for all DocPerm { - 'doctype': u'DocPerm', - 'name': '__common__', + u'doctype': u'DocPerm', + u'name': u'__common__', 'parent': u'Employee', 'parentfield': u'permissions', 'parenttype': u'DocType', @@ -50,102 +50,13 @@ # DocType, Employee { - 'doctype': 'DocType', - 'name': u'Employee' - }, - - # DocPerm - { - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'All' - }, - - # DocPerm - { - 'cancel': 1, - 'create': 1, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'HR User', - 'write': 1 - }, - - # DocPerm - { - 'cancel': 1, - 'create': 1, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'HR Manager', - 'write': 1 - }, - - # DocPerm - { - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'HR User' - }, - - # DocPerm - { - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'HR Manager' - }, - - # DocPerm - { - 'amend': 0, - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'match': u'owner', - 'permlevel': 0, - 'submit': 0, - 'write': 0 - }, - - # DocPerm - { - 'amend': 0, - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'match': u'owner', - 'permlevel': 0, - 'submit': 0, - 'write': 0 - }, - - # DocPerm - { - 'amend': 0, - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'match': u'owner', - 'permlevel': 0, - 'submit': 0, - 'write': 0 - }, - - # DocPerm - { - 'amend': 0, - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'match': u'owner', - 'permlevel': 0, - 'submit': 0, - 'write': 0 + u'doctype': u'DocType', + u'name': u'Employee' }, # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'basic_information', 'fieldtype': u'Section Break', 'label': u'Basic Information', @@ -155,7 +66,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'column_break0', 'fieldtype': u'Column Break', 'permlevel': 0, @@ -164,8 +75,9 @@ # DocField { - 'description': u'To manage multiple series please go to Setup > Manage Series', - 'doctype': u'DocField', + 'colour': u'White:FFF', + 'description': u'To setup, please go to Setup > Naming Series', + u'doctype': u'DocField', 'fieldname': u'naming_series', 'fieldtype': u'Select', 'label': u'Naming Series', @@ -180,7 +92,7 @@ # DocField { 'colour': u'White:FFF', - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'salutation', 'fieldtype': u'Select', 'label': u'Salutation', @@ -195,10 +107,10 @@ # DocField { 'colour': u'White:FFF', - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'employee_name', 'fieldtype': u'Data', - 'label': u'Employee Name', + 'label': u'Full Name', 'oldfieldname': u'employee_name', 'oldfieldtype': u'Data', 'permlevel': 0, @@ -207,7 +119,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'employee_number', 'fieldtype': u'Data', 'in_filter': 1, @@ -221,7 +133,28 @@ # DocField { 'colour': u'White:FFF', - 'doctype': u'DocField', + 'description': u'System User (login) ID. If set, it will become default for all HR forms.', + u'doctype': u'DocField', + 'fieldname': u'user_id', + 'fieldtype': u'Link', + 'label': u'User ID', + 'options': u'Profile', + 'permlevel': 0 + }, + + # DocField + { + u'doctype': u'DocField', + 'fieldname': u'column_break1', + 'fieldtype': u'Column Break', + 'permlevel': 0, + 'width': u'50%' + }, + + # DocField + { + 'colour': u'White:FFF', + u'doctype': u'DocField', 'fieldname': u'date_of_joining', 'fieldtype': u'Date', 'label': u'Date of Joining', @@ -234,7 +167,7 @@ # DocField { 'colour': u'White:FFF', - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'date_of_birth', 'fieldtype': u'Date', 'in_filter': 1, @@ -249,7 +182,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'gender', 'fieldtype': u'Select', 'in_filter': 1, @@ -264,7 +197,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'company', 'fieldtype': u'Select', 'in_filter': 1, @@ -277,18 +210,26 @@ # DocField { - 'doctype': u'DocField', - 'fieldname': u'column_break1', + u'doctype': u'DocField', + 'fieldname': u'employment_details', + 'fieldtype': u'Section Break', + 'label': u'Employment Details', + 'permlevel': 0 + }, + + # DocField + { + u'doctype': u'DocField', + 'fieldname': u'col_break_21', 'fieldtype': u'Column Break', - 'permlevel': 0, - 'width': u'50%' + 'permlevel': 0 }, # DocField { 'colour': u'White:FFF', 'default': u'Active', - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'status', 'fieldtype': u'Select', 'in_filter': 1, @@ -303,7 +244,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'employment_type', 'fieldtype': u'Link', 'in_filter': 1, @@ -317,7 +258,29 @@ # DocField { - 'doctype': u'DocField', + 'colour': u'White:FFF', + 'description': u'Applicable Holiday List', + u'doctype': u'DocField', + 'fieldname': u'holiday_list', + 'fieldtype': u'Link', + 'label': u'Holiday List', + 'oldfieldname': u'holiday_list', + 'oldfieldtype': u'Link', + 'options': u'Holiday List', + 'permlevel': 0 + }, + + # DocField + { + u'doctype': u'DocField', + 'fieldname': u'col_break_22', + 'fieldtype': u'Column Break', + 'permlevel': 0 + }, + + # DocField + { + u'doctype': u'DocField', 'fieldname': u'scheduled_confirmation_date', 'fieldtype': u'Date', 'in_filter': 1, @@ -330,7 +293,8 @@ # DocField { - 'doctype': u'DocField', + 'colour': u'White:FFF', + u'doctype': u'DocField', 'fieldname': u'final_confirmation_date', 'fieldtype': u'Date', 'label': u'Final Confirmation Date', @@ -342,7 +306,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'contract_end_date', 'fieldtype': u'Date', 'in_filter': 1, @@ -355,7 +319,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'date_of_retirement', 'fieldtype': u'Date', 'label': u'Date Of Retirement', @@ -366,21 +330,7 @@ # DocField { - 'colour': u'White:FFF', - 'description': u'Applicable Holiday List', - 'doctype': u'DocField', - 'fieldname': u'holiday_list', - 'fieldtype': u'Link', - 'label': u'Holiday List', - 'oldfieldname': u'holiday_list', - 'oldfieldtype': u'Link', - 'options': u'Holiday List', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'job_profile', 'fieldtype': u'Section Break', 'label': u'Job Profile', @@ -389,7 +339,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'column_break2', 'fieldtype': u'Column Break', 'permlevel': 0, @@ -399,7 +349,7 @@ # DocField { 'colour': u'White:FFF', - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'branch', 'fieldtype': u'Link', 'in_filter': 1, @@ -414,7 +364,7 @@ # DocField { 'colour': u'White:FFF', - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'department', 'fieldtype': u'Link', 'in_filter': 1, @@ -429,7 +379,7 @@ # DocField { 'colour': u'White:FFF', - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'designation', 'fieldtype': u'Link', 'in_filter': 1, @@ -445,7 +395,7 @@ # DocField { 'colour': u'White:FFF', - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'grade', 'fieldtype': u'Link', 'in_filter': 1, @@ -459,7 +409,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'reports_to', 'fieldtype': u'Link', 'label': u'Reports to', @@ -472,7 +422,7 @@ # DocField { 'description': u'Provide email id registered in company', - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'company_email', 'fieldtype': u'Data', 'in_filter': 1, @@ -485,7 +435,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'salary_information', 'fieldtype': u'Column Break', 'label': u'Salary Information', @@ -497,7 +447,7 @@ # DocField { 'colour': u'White:FFF', - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'salary_mode', 'fieldtype': u'Select', 'label': u'Salary Mode', @@ -512,7 +462,7 @@ { 'colour': u'White:FFF', 'depends_on': u"eval:doc.salary_mode == 'Bank'", - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'bank_name', 'fieldtype': u'Data', 'hidden': 0, @@ -528,7 +478,7 @@ { 'colour': u'White:FFF', 'depends_on': u"eval:doc.salary_mode == 'Bank'", - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'bank_ac_no', 'fieldtype': u'Data', 'hidden': 0, @@ -540,7 +490,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'esic_card_no', 'fieldtype': u'Data', 'label': u'ESIC CARD No', @@ -551,7 +501,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'pf_number', 'fieldtype': u'Data', 'label': u'PF Number', @@ -562,7 +512,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'gratuity_lic_id', 'fieldtype': u'Data', 'label': u'Gratuity LIC ID', @@ -573,7 +523,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'contact_details', 'fieldtype': u'Section Break', 'label': u'Contact Details', @@ -582,7 +532,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'column_break3', 'fieldtype': u'Column Break', 'permlevel': 0, @@ -591,7 +541,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'cell_number', 'fieldtype': u'Data', 'label': u'Cell Number', @@ -600,7 +550,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'personal_email', 'fieldtype': u'Data', 'label': u'Personal Email', @@ -609,7 +559,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'notice_number_of_days', 'fieldtype': u'Int', 'label': u'Notice - Number of Days', @@ -620,7 +570,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'emergency_contact_details', 'fieldtype': u'HTML', 'label': u'Emergency Contact Details', @@ -630,7 +580,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'person_to_be_contacted', 'fieldtype': u'Data', 'label': u'Person To Be Contacted', @@ -639,7 +589,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'relation', 'fieldtype': u'Data', 'label': u'Relation', @@ -648,7 +598,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'emergency_phone_number', 'fieldtype': u'Data', 'label': u'Emergency Phone Number', @@ -657,7 +607,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'column_break4', 'fieldtype': u'Column Break', 'permlevel': 0, @@ -666,7 +616,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'permanent_accommodation_type', 'fieldtype': u'Select', 'label': u'Permanent Accommodation Type', @@ -676,7 +626,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'permanent_address', 'fieldtype': u'Small Text', 'label': u'Permanent Address', @@ -685,7 +635,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'current_accommodation_type', 'fieldtype': u'Select', 'label': u'Current Accommodation Type', @@ -695,7 +645,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'current_address', 'fieldtype': u'Small Text', 'label': u'Current Address', @@ -704,7 +654,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'personal_details', 'fieldtype': u'Section Break', 'label': u'Personal Details', @@ -713,7 +663,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'column_break5', 'fieldtype': u'Column Break', 'permlevel': 0, @@ -722,7 +672,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'pan_number', 'fieldtype': u'Data', 'label': u'PAN Number', @@ -731,7 +681,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'passport_number', 'fieldtype': u'Data', 'label': u'Passport Number', @@ -740,20 +690,7 @@ # DocField { - 'colour': u'White:FFF', - 'doctype': u'DocField', - 'fieldname': u'employee_profile', - 'fieldtype': u'Button', - 'hidden': 1, - 'label': u'Employee Profile', - 'oldfieldtype': u'Button', - 'permlevel': 0, - 'trigger': u'Client' - }, - - # DocField - { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'date_of_issue', 'fieldtype': u'Date', 'label': u'Date of Issue', @@ -762,7 +699,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'valid_upto', 'fieldtype': u'Date', 'label': u'Valid Upto', @@ -772,7 +709,7 @@ # DocField { 'colour': u'White:FFF', - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'salary_structure', 'fieldtype': u'Button', 'hidden': 1, @@ -784,7 +721,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'place_of_issue', 'fieldtype': u'Data', 'label': u'Place of Issue', @@ -793,7 +730,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'marital_status', 'fieldtype': u'Select', 'label': u'Marital Status', @@ -803,7 +740,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'blood_group', 'fieldtype': u'Select', 'label': u'Blood Group', @@ -813,7 +750,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'column_break6', 'fieldtype': u'Column Break', 'permlevel': 0, @@ -824,7 +761,7 @@ { 'colour': u'White:FFF', 'description': u'Here you can maintain family details like name and occupation of parent, spouse and children', - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'family_background', 'fieldtype': u'Small Text', 'label': u'Family Background', @@ -835,7 +772,7 @@ { 'colour': u'White:FFF', 'description': u'Here you can maintain height, weight, allergies, medical concerns etc', - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'health_details', 'fieldtype': u'Small Text', 'label': u'Health Details', @@ -844,7 +781,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'educational_qualification', 'fieldtype': u'Section Break', 'label': u'Educational Qualification', @@ -853,7 +790,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'educational_qualification_details', 'fieldtype': u'Table', 'label': u'Educational Qualification Details', @@ -863,7 +800,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'career_history', 'fieldtype': u'Section Break', 'label': u'Career History', @@ -872,7 +809,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'previous_work_experience', 'fieldtype': u'Section Break', 'label': u'Previous Work Experience', @@ -882,7 +819,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'previous_experience_details', 'fieldtype': u'Table', 'label': u'Employee External Work History', @@ -892,7 +829,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'history_in_company', 'fieldtype': u'Section Break', 'label': u'History In Company', @@ -902,7 +839,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'experience_in_company_details', 'fieldtype': u'Table', 'label': u'Employee Internal Work Historys', @@ -912,7 +849,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'exit', 'fieldtype': u'Section Break', 'label': u'Exit', @@ -922,7 +859,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'column_break7', 'fieldtype': u'Column Break', 'permlevel': 0, @@ -931,7 +868,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'resignation_letter_date', 'fieldtype': u'Date', 'label': u'Resignation Letter Date', @@ -942,7 +879,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'relieving_date', 'fieldtype': u'Date', 'in_filter': 1, @@ -954,7 +891,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'reason_for_leaving', 'fieldtype': u'Data', 'label': u'Reason for Leaving', @@ -965,7 +902,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'leave_encashed', 'fieldtype': u'Select', 'label': u'Leave Encashed?', @@ -977,7 +914,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'encashment_date', 'fieldtype': u'Date', 'label': u'Encashment Date', @@ -988,7 +925,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'exit_interview_details', 'fieldtype': u'Column Break', 'label': u'Exit Interview Details', @@ -1000,7 +937,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'held_on', 'fieldtype': u'Date', 'label': u'Held On', @@ -1011,7 +948,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'reason_for_resignation', 'fieldtype': u'Select', 'label': u'Reason for Resignation', @@ -1023,7 +960,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'new_workplace', 'fieldtype': u'Data', 'label': u'New Workplace', @@ -1034,7 +971,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'feedback', 'fieldtype': u'Small Text', 'label': u'Feedback', @@ -1045,7 +982,7 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'file_list', 'fieldtype': u'Text', 'hidden': 1, @@ -1056,12 +993,77 @@ # DocField { - 'doctype': u'DocField', + u'doctype': u'DocField', 'fieldname': u'trash_reason', 'fieldtype': u'Small Text', 'label': u'Trash Reason', 'oldfieldname': u'trash_reason', 'oldfieldtype': u'Small Text', 'permlevel': 1 + }, + + # DocPerm + { + 'amend': 0, + 'cancel': 0, + 'create': 0, + u'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Employee', + 'submit': 0, + 'write': 0 + }, + + # DocPerm + { + 'amend': 0, + 'cancel': 0, + 'create': 0, + u'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Employee', + 'submit': 0, + 'write': 0 + }, + + # DocPerm + { + u'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'All' + }, + + # DocPerm + { + 'cancel': 1, + 'create': 1, + u'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'HR User', + 'write': 1 + }, + + # DocPerm + { + 'cancel': 1, + 'create': 1, + u'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'HR Manager', + 'write': 1 + }, + + # DocPerm + { + u'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'HR User' + }, + + # DocPerm + { + u'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'HR Manager' } -] +] \ No newline at end of file