fixed employee permissions, fixed bug in import_merge of timestamps

This commit is contained in:
Rushabh Mehta 2012-11-30 12:02:00 +05:30
parent 35c017a78f
commit 86adcaa113
6 changed files with 966 additions and 1185 deletions

View File

@ -1,4 +1,7 @@
erpnext.updates = [ erpnext.updates = [
["30th November 2012", [
"Auto Notifications: System will prompt user with pre-set message for auto-notification.",
]],
["29th November 2012", [ ["29th November 2012", [
"EMail: Form Emails are now via Communication (with Rich Text Etc.).", "EMail: Form Emails are now via Communication (with Rich Text Etc.).",
]], ]],

View File

@ -38,6 +38,8 @@ class DocType:
elif ret[0][0]=='Employee Number': elif ret[0][0]=='Employee Number':
self.doc.name = make_autoname(self.doc.employee_number) self.doc.name = make_autoname(self.doc.employee_number)
self.doc.employee = self.doc.name
def get_retirement_date(self): def get_retirement_date(self):
import datetime import datetime
ret = {} ret = {}
@ -51,6 +53,7 @@ class DocType:
return ret_sal_struct and ret_sal_struct[0][0] or '' return ret_sal_struct and ret_sal_struct[0][0] or ''
def validate(self): def validate(self):
self.doc.employee = self.doc.name
self.validate_date() self.validate_date()
self.validate_email() self.validate_email()
self.validate_name() self.validate_name()

File diff suppressed because it is too large Load Diff

View File

@ -1,120 +1,75 @@
# DocType, Employee External Work History
[ [
# These values are common in all dictionaries
{ {
'creation': '2012-03-27 14:35:59', "owner": "Administrator",
'docstatus': 0, "docstatus": 0,
'modified': '2012-03-27 14:35:59', "creation": "2012-07-03 13:29:41",
'modified_by': u'Administrator', "modified_by": "Administrator",
'owner': u'Administrator' "modified": "2012-11-30 11:57:58"
}, },
# These values are common for all DocType
{ {
'colour': u'White:FFF', "istable": 1,
'doctype': 'DocType', "name": "__common__",
'istable': 1, "doctype": "DocType",
'module': u'HR', "module": "HR"
'name': '__common__',
'section_style': u'Simple',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 3
}, },
# These values are common for all DocField
{ {
'doctype': u'DocField', "name": "__common__",
'name': '__common__', "parent": "Employee External Work History",
'parent': u'Employee External Work History', "doctype": "DocField",
'parentfield': u'fields', "parenttype": "DocType",
'parenttype': u'DocType', "permlevel": 0,
'permlevel': 0 "parentfield": "fields"
}, },
# These values are common for all DocPerm
{ {
'create': 1, "name": "Employee External Work History",
'doctype': u'DocPerm', "doctype": "DocType"
'name': '__common__',
'parent': u'Employee External Work History',
'parentfield': u'permissions',
'parenttype': u'DocType',
'permlevel': 0,
'read': 1,
'role': u'All',
'write': 1
}, },
# DocType, Employee External Work History
{ {
'doctype': 'DocType', "oldfieldtype": "Data",
'name': u'Employee External Work History' "doctype": "DocField",
"label": "Company",
"oldfieldname": "company_name",
"fieldname": "company_name",
"fieldtype": "Data"
}, },
# DocPerm
{ {
'doctype': u'DocPerm' "oldfieldtype": "Data",
"doctype": "DocField",
"label": "Designation",
"oldfieldname": "designation",
"fieldname": "designation",
"fieldtype": "Data"
}, },
# DocField
{ {
'doctype': u'DocField', "oldfieldtype": "Currency",
'fieldname': u'company_name', "doctype": "DocField",
'fieldtype': u'Data', "label": "Salary",
'label': u'Company', "oldfieldname": "salary",
'oldfieldname': u'company_name', "fieldname": "salary",
'oldfieldtype': u'Data' "fieldtype": "Currency"
}, },
# DocField
{ {
'doctype': u'DocField', "oldfieldtype": "Small Text",
'fieldname': u'designation', "doctype": "DocField",
'fieldtype': u'Data', "label": "Address",
'label': u'Designation', "oldfieldname": "address",
'oldfieldname': u'designation', "fieldname": "address",
'oldfieldtype': u'Data' "fieldtype": "Small Text"
}, },
# DocField
{ {
'doctype': u'DocField', "oldfieldtype": "Data",
'fieldname': u'salary', "doctype": "DocField",
'fieldtype': u'Currency', "label": "Contact",
'label': u'Salary', "oldfieldname": "contact",
'oldfieldname': u'salary', "fieldname": "contact",
'oldfieldtype': u'Currency' "fieldtype": "Data"
}, },
# DocField
{ {
'doctype': u'DocField', "oldfieldtype": "Data",
'fieldname': u'address', "doctype": "DocField",
'fieldtype': u'Small Text', "label": "Total Experience",
'label': u'Address', "oldfieldname": "total_experience",
'oldfieldname': u'address', "fieldname": "total_experience",
'oldfieldtype': u'Small Text' "fieldtype": "Data"
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'contact',
'fieldtype': u'Data',
'label': u'Contact',
'oldfieldname': u'contact',
'oldfieldtype': u'Data'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'total_experience',
'fieldtype': u'Data',
'label': u'Total Experience',
'oldfieldname': u'total_experience',
'oldfieldtype': u'Data'
} }
] ]

View File

@ -0,0 +1,6 @@
import webnotes
def execute():
webnotes.clear_perms("Employee")
webnotes.reload_doc("hr", "doctype", "employee")
webnotes.conn.sql("""update tabEmployee set employee=name""")

View File

@ -689,4 +689,8 @@ patch_list = [
'patch_module': 'patches.november_2012', 'patch_module': 'patches.november_2012',
'patch_file': 'add_theme_to_profile', 'patch_file': 'add_theme_to_profile',
}, },
{
'patch_module': 'patches.november_2012',
'patch_file': 'add_employee_field_in_employee',
},
] ]