Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: set title and search fields in HR and Payroll doctypes #29351

Merged
merged 2 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@
}
],
"links": [],
"modified": "2020-01-21 17:30:36.334395",
"modified": "2022-01-18 19:27:35.649424",
"modified_by": "Administrator",
"module": "HR",
"name": "Appointment Letter",
"name_case": "Title Case",
"naming_rule": "Expression (old style)",
"owner": "Administrator",
"permissions": [
{
Expand Down Expand Up @@ -118,7 +119,10 @@
"write": 1
}
],
"search_fields": "applicant_name, company",
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"title_field": "applicant_name",
"track_changes": 1
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"actions": [],
"autoname": "HR-APP-LETTER-TEMP-.#####",
"autoname": "field:template_name",
"creation": "2019-12-26 12:20:14.219578",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"template_name",
"introduction",
"terms",
"closing_notes"
Expand All @@ -29,13 +30,21 @@
"label": "Terms",
"options": "Appointment Letter content",
"reqd": 1
},
{
"fieldname": "template_name",
"fieldtype": "Data",
"label": "Template Name",
"reqd": 1,
"unique": 1
}
],
"links": [],
"modified": "2020-01-21 17:00:46.779420",
"modified": "2022-01-18 19:25:14.614616",
"modified_by": "Administrator",
"module": "HR",
"name": "Appointment Letter Template",
"naming_rule": "By fieldname",
"owner": "Administrator",
"permissions": [
{
Expand Down Expand Up @@ -63,7 +72,10 @@
"write": 1
}
],
"search_fields": "template_name",
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"title_field": "template_name",
"track_changes": 1
}
9 changes: 6 additions & 3 deletions erpnext/hr/doctype/leave_allocation/leave_allocation.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,11 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2021-10-01 15:28:26.335104",
"modified": "2022-01-18 19:15:53.262536",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Allocation",
"naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
Expand Down Expand Up @@ -278,5 +279,7 @@
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",
"timeline_field": "employee"
}
"states": [],
"timeline_field": "employee",
"title_field": "employee_name"
}
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ def test_earned_leaves_creation(self):

leave_policy = frappe.get_doc({
"doctype": "Leave Policy",
"title": "Test Leave Policy",
"leave_policy_details": [{"leave_type": leave_type, "annual_allocation": 6}]
}).insert()

Expand Down
6 changes: 5 additions & 1 deletion erpnext/hr/doctype/leave_encashment/leave_encashment.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,11 @@
],
"is_submittable": 1,
"links": [],
"modified": "2021-03-31 22:32:55.492327",
"modified": "2022-01-18 19:16:52.414356",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Encashment",
"naming_rule": "Expression (old style)",
"owner": "Administrator",
"permissions": [
{
Expand Down Expand Up @@ -218,7 +219,10 @@
"write": 1
}
],
"search_fields": "employee,employee_name",
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"title_field": "employee_name",
"track_changes": 1
}
141 changes: 25 additions & 116 deletions erpnext/hr/doctype/leave_policy/leave_policy.json
Original file line number Diff line number Diff line change
@@ -1,131 +1,55 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"actions": [],
"autoname": "HR-LPOL-.YYYY.-.#####",
"beta": 0,
"creation": "2018-04-13 16:06:19.507624",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"title",
"leave_allocations_section",
"leave_policy_details",
"amended_from"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 1,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "leave_allocations_section",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Leave Allocations",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"label": "Leave Allocations"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "leave_policy_details",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Leave Policy Details",
"length": 0,
"no_copy": 0,
"options": "Leave Policy Detail",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Amended From",
"length": 0,
"no_copy": 1,
"options": "Leave Policy",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"read_only": 1
},
{
"allow_on_submit": 1,
"fieldname": "title",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Title",
"reqd": 1
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-29 08:42:53.363088",
"links": [],
"modified": "2022-01-19 13:07:40.556500",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Policy",
"name_case": "",
"naming_rule": "Expression (old style)",
"owner": "Administrator",
"permissions": [
{
Expand All @@ -135,14 +59,10 @@
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"write": 1
Expand All @@ -154,14 +74,10 @@
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "HR Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"write": 1
Expand All @@ -173,26 +89,19 @@
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "HR User",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"search_fields": "title",
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0,
"track_views": 0
"states": [],
"title_field": "title",
"track_changes": 1
}
1 change: 1 addition & 0 deletions erpnext/hr/doctype/leave_policy/test_leave_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def create_leave_policy(**args):
args = frappe._dict(args)
return frappe.get_doc({
"doctype": "Leave Policy",
"title": "Test Leave Policy",
"leave_policy_details": [{
"leave_type": args.leave_type or "_Test Leave Type",
"annual_allocation": args.annual_allocation or 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def test_earned_leave_allocation(self):

leave_policy = frappe.get_doc({
"doctype": "Leave Policy",
"title": "Test Leave Policy",
"leave_policy_details": [{"leave_type": leave_type.name, "annual_allocation": 6}]
}).insert()

Expand Down
Loading