From 2f77ccce1b999f236697e0cff002beb87c427942 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 13 Apr 2018 20:20:46 +0530 Subject: [PATCH] New doctypes for HR and Accounting (#13652) --- .../compensatory_leave_request.py | 4 + .../test_compensatory_leave_request.py | 6 +- erpnext/hr/doctype/employee/employee.json | 32 +++ .../employee_benefit_claim.json | 3 - .../__init__.py | 0 .../employee_tax_excemption_category.js | 8 + .../employee_tax_excemption_category.json | 194 ++++++++++++++++++ .../employee_tax_excemption_category.py | 10 + .../test_employee_tax_excemption_category.js | 23 +++ .../test_employee_tax_excemption_category.py | 10 + .../doctype/leave_period/test_leave_period.py | 2 +- 11 files changed, 287 insertions(+), 5 deletions(-) create mode 100644 erpnext/hr/doctype/employee_tax_excemption_category/__init__.py create mode 100644 erpnext/hr/doctype/employee_tax_excemption_category/employee_tax_excemption_category.js create mode 100644 erpnext/hr/doctype/employee_tax_excemption_category/employee_tax_excemption_category.json create mode 100644 erpnext/hr/doctype/employee_tax_excemption_category/employee_tax_excemption_category.py create mode 100644 erpnext/hr/doctype/employee_tax_excemption_category/test_employee_tax_excemption_category.js create mode 100644 erpnext/hr/doctype/employee_tax_excemption_category/test_employee_tax_excemption_category.py diff --git a/erpnext/hr/doctype/compensatory_leave_request/compensatory_leave_request.py b/erpnext/hr/doctype/compensatory_leave_request/compensatory_leave_request.py index 90d482abcd9..c211792f004 100644 --- a/erpnext/hr/doctype/compensatory_leave_request/compensatory_leave_request.py +++ b/erpnext/hr/doctype/compensatory_leave_request/compensatory_leave_request.py @@ -7,6 +7,10 @@ import frappe from frappe.model.document import Document class CompensatoryLeaveRequest(Document): +<<<<<<< HEAD def validate_present(self): pass +======= + pass +>>>>>>> New doctypes for HR and Accounting (#13652) diff --git a/erpnext/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py b/erpnext/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py index ea73ca987ad..edad5717007 100644 --- a/erpnext/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py +++ b/erpnext/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py @@ -7,6 +7,7 @@ import frappe import unittest class TestCompensatoryLeaveRequest(unittest.TestCase): +<<<<<<< HEAD def get_compensatory_leave_request(self): return frappe.get_doc('Compensatory Leave Request', dict( employee = employee, @@ -38,4 +39,7 @@ class TestCompensatoryLeaveRequest(unittest.TestCase): self.assertRaises(MaxLeavesLimitCrossed, compensatory_leave_request.submit) frappe.db.set_value('Leave Type', compensatory_leave_request.leave_type, 'max_leaves_allowed', 10) - \ No newline at end of file + +======= + pass +>>>>>>> New doctypes for HR and Accounting (#13652) diff --git a/erpnext/hr/doctype/employee/employee.json b/erpnext/hr/doctype/employee/employee.json index 2d76dcf303b..0cf6805693a 100644 --- a/erpnext/hr/doctype/employee/employee.json +++ b/erpnext/hr/doctype/employee/employee.json @@ -1262,6 +1262,38 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "default_leave_policy", + "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": "Default Leave policy", + "length": 0, + "no_copy": 0, + "options": "Leave Policy", + "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 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, diff --git a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.json b/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.json index 5e2b34b7d7a..b358247376b 100644 --- a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.json +++ b/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.json @@ -457,7 +457,4 @@ "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", - "title_field": "employee_name", "track_changes": 1, - "track_seen": 0 -} \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_tax_excemption_category/__init__.py b/erpnext/hr/doctype/employee_tax_excemption_category/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/hr/doctype/employee_tax_excemption_category/employee_tax_excemption_category.js b/erpnext/hr/doctype/employee_tax_excemption_category/employee_tax_excemption_category.js new file mode 100644 index 00000000000..2c4377cdbda --- /dev/null +++ b/erpnext/hr/doctype/employee_tax_excemption_category/employee_tax_excemption_category.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Employee Tax Excemption Category', { + refresh: function(frm) { + + } +}); diff --git a/erpnext/hr/doctype/employee_tax_excemption_category/employee_tax_excemption_category.json b/erpnext/hr/doctype/employee_tax_excemption_category/employee_tax_excemption_category.json new file mode 100644 index 00000000000..e49e780ffaa --- /dev/null +++ b/erpnext/hr/doctype/employee_tax_excemption_category/employee_tax_excemption_category.json @@ -0,0 +1,194 @@ +{ + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 1, + "allow_rename": 1, + "autoname": "Prompt", + "beta": 0, + "creation": "2018-04-13 16:51:36.971140", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "deduction_component", + "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": "Deduction Component", + "length": 0, + "no_copy": 0, + "options": "Salary Component", + "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 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "max_amount", + "fieldtype": "Currency", + "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": "Max Amount", + "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 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "is_active", + "fieldtype": "Check", + "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": "Is Active", + "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 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2018-04-13 16:52:11.640756", + "modified_by": "Administrator", + "module": "HR", + "name": "Employee Tax Excemption Category", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "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": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "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": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "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": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_tax_excemption_category/employee_tax_excemption_category.py b/erpnext/hr/doctype/employee_tax_excemption_category/employee_tax_excemption_category.py new file mode 100644 index 00000000000..1586bf136c5 --- /dev/null +++ b/erpnext/hr/doctype/employee_tax_excemption_category/employee_tax_excemption_category.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class EmployeeTaxExcemptionCategory(Document): + pass diff --git a/erpnext/hr/doctype/employee_tax_excemption_category/test_employee_tax_excemption_category.js b/erpnext/hr/doctype/employee_tax_excemption_category/test_employee_tax_excemption_category.js new file mode 100644 index 00000000000..3872438079e --- /dev/null +++ b/erpnext/hr/doctype/employee_tax_excemption_category/test_employee_tax_excemption_category.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Employee Tax Excemption Category", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Employee Tax Excemption Category + () => frappe.tests.make('Employee Tax Excemption Category', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/erpnext/hr/doctype/employee_tax_excemption_category/test_employee_tax_excemption_category.py b/erpnext/hr/doctype/employee_tax_excemption_category/test_employee_tax_excemption_category.py new file mode 100644 index 00000000000..7438f6464c6 --- /dev/null +++ b/erpnext/hr/doctype/employee_tax_excemption_category/test_employee_tax_excemption_category.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt +from __future__ import unicode_literals + +import frappe +import unittest + +class TestEmployeeTaxExcemptionCategory(unittest.TestCase): + pass diff --git a/erpnext/hr/doctype/leave_period/test_leave_period.py b/erpnext/hr/doctype/leave_period/test_leave_period.py index 381fbb234df..11d4ec5cac3 100644 --- a/erpnext/hr/doctype/leave_period/test_leave_period.py +++ b/erpnext/hr/doctype/leave_period/test_leave_period.py @@ -28,4 +28,4 @@ class TestLeavePeriod(unittest.TestCase): def test_duplicate_grant(self): leave_period = self.test_leave_grant() self.assertRaises(DuplicateLeaveGrant, leave_period.grant_leaves) - \ No newline at end of file +