chore: Clean up imports (#27302)

* chore: Added isort to pre-commit config

* chore: Sort imports with isort

* chore: Clean up imports with pycln

* chore: Sort imports with isort

* chore: Fix import issues

* chore: Clean up sider issues

* chore: Remove import errors from flake8 ignore list

* chore: Clean up lint issues
This commit is contained in:
Chillar Anand
2021-09-02 16:44:59 +05:30
committed by GitHub
parent b25d28e023
commit 915b34391c
2060 changed files with 7707 additions and 3083 deletions

View File

@@ -3,9 +3,11 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AppointmentLetter(Document):
pass

View File

@@ -6,5 +6,6 @@ from __future__ import unicode_literals
# import frappe
import unittest
class TestAppointmentLetter(unittest.TestCase):
pass

View File

@@ -3,8 +3,10 @@
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class AppointmentLettercontent(Document):
pass

View File

@@ -3,8 +3,10 @@
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class AppointmentLetterTemplate(Document):
pass

View File

@@ -6,5 +6,6 @@ from __future__ import unicode_literals
# import frappe
import unittest
class TestAppointmentLetterTemplate(unittest.TestCase):
pass

View File

@@ -2,15 +2,16 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
from frappe.utils import flt, getdate
from frappe import _
from frappe.model.mapper import get_mapped_doc
from frappe.model.document import Document
from erpnext.hr.utils import set_employee_name, validate_active_employee
class Appraisal(Document):
def validate(self):
if not self.status:

View File

@@ -2,7 +2,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Appraisal')

View File

@@ -2,9 +2,9 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AppraisalGoal(Document):
pass

View File

@@ -2,11 +2,12 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, flt
from frappe import _
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import cint, flt
class AppraisalTemplate(Document):
def validate(self):

View File

@@ -1,5 +1,5 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return {

View File

@@ -2,7 +2,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Appraisal Template')

View File

@@ -2,9 +2,9 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AppraisalTemplateGoal(Document):
pass

View File

@@ -2,14 +2,15 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, nowdate
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import cstr, get_datetime, formatdate
from frappe.utils import cstr, formatdate, get_datetime, getdate, nowdate
from erpnext.hr.utils import validate_active_employee
class Attendance(Document):
def validate(self):
from erpnext.controllers.status_updater import validate_status
@@ -134,7 +135,6 @@ def mark_attendance(employee, attendance_date, status, shift=None, leave_type=No
@frappe.whitelist()
def mark_bulk_attendance(data):
import json
from pprint import pprint
if isinstance(data, str):
data = json.loads(data)
data = frappe._dict(data)

View File

@@ -1,5 +1,5 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return {

View File

@@ -2,8 +2,9 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe
from frappe.utils import nowdate
test_records = frappe.get_test_records('Attendance')

View File

@@ -3,12 +3,15 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import date_diff, add_days, getdate
from frappe.utils import add_days, date_diff, getdate
from erpnext.hr.doctype.employee.employee import is_holiday
from erpnext.hr.utils import validate_dates, validate_active_employee
from erpnext.hr.utils import validate_active_employee, validate_dates
class AttendanceRequest(Document):
def validate(self):

View File

@@ -1,5 +1,6 @@
from __future__ import unicode_literals
def get_data():
return {
'fieldname': 'attendance_request',

View File

@@ -3,11 +3,12 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import nowdate
from datetime import date
import frappe
from frappe.utils import nowdate
test_dependencies = ["Employee"]
class TestAttendanceRequest(unittest.TestCase):

View File

@@ -2,9 +2,9 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Branch(Document):
pass

View File

@@ -2,6 +2,6 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
test_records = frappe.get_test_records('Branch')

View File

@@ -3,12 +3,21 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import date_diff, add_days, getdate, cint, format_date
from frappe.model.document import Document
from erpnext.hr.utils import validate_dates, validate_overlap, get_leave_period, validate_active_employee, \
create_additional_leave_ledger_entry, get_holiday_dates_for_employee
from frappe.utils import add_days, cint, date_diff, format_date, getdate
from erpnext.hr.utils import (
create_additional_leave_ledger_entry,
get_holiday_dates_for_employee,
get_leave_period,
validate_active_employee,
validate_dates,
validate_overlap,
)
class CompensatoryLeaveRequest(Document):

View File

@@ -3,12 +3,14 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import today, add_months, add_days
import frappe
from frappe.utils import add_days, add_months, today
from erpnext.hr.doctype.attendance_request.test_attendance_request import get_employee
from erpnext.hr.doctype.leave_period.test_leave_period import create_leave_period
from erpnext.hr.doctype.leave_application.leave_application import get_leave_balance_on
from erpnext.hr.doctype.leave_period.test_leave_period import create_leave_period
test_dependencies = ["Employee"]

View File

@@ -3,11 +3,11 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
from email_reply_parser import EmailReplyParser
from erpnext.hr.doctype.employee.employee import is_holiday
from frappe import _
from frappe.model.document import Document
from frappe.utils import global_date_format
from six import string_types

View File

@@ -4,8 +4,9 @@
from __future__ import unicode_literals
import os
import frappe
import unittest
import frappe
import frappe.utils
# test_records = frappe.get_test_records('Daily Work Summary')
@@ -64,8 +65,7 @@ class TestDailyWorkSummary(unittest.TestCase):
filters=dict(email=('!=', 'test@example.com')))
self.setup_groups(hour)
from erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group \
import trigger_emails
from erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group import trigger_emails
trigger_emails()
# check if emails are created

View File

@@ -3,13 +3,16 @@
# # For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import frappe.utils
from frappe import _
from frappe.model.document import Document
from erpnext.hr.doctype.daily_work_summary.daily_work_summary import get_user_emails_from_group
from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday
class DailyWorkSummaryGroup(Document):
def validate(self):
if self.users:

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class DailyWorkSummaryGroupUser(Document):
pass

View File

@@ -2,10 +2,12 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import NestedSet, get_root_of
from erpnext.utilities.transaction_base import delete_events
from frappe.model.document import Document
class Department(NestedSet):
nsm_parent_field = 'parent_department'

View File

@@ -1,9 +1,11 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe
test_ignore = ["Leave Block List"]
class TestDepartment(unittest.TestCase):
def test_remove_department_data(self):

View File

@@ -3,10 +3,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
class DepartmentApprover(Document):
pass

View File

@@ -2,9 +2,9 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Designation(Document):
pass

View File

@@ -2,8 +2,8 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
# test_records = frappe.get_test_records('Designation')
def create_designation(**args):

View File

@@ -3,8 +3,10 @@
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class DesignationSkill(Document):
pass

View File

@@ -3,7 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class Driver(Document):
pass

View File

@@ -5,5 +5,6 @@ from __future__ import unicode_literals
import unittest
class TestDriver(unittest.TestCase):
pass

View File

@@ -3,7 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class DrivingLicenseCategory(Document):
pass

View File

@@ -1,15 +1,21 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.utils import getdate, validate_email_address, today, add_years, cstr
from frappe import _, scrub, throw
from frappe.model.naming import set_name_by_naming_series
from frappe import throw, _, scrub
from frappe.permissions import add_user_permission, remove_user_permission, \
set_user_permission_if_allowed, has_permission, get_doc_permissions
from erpnext.utilities.transaction_base import delete_events
from frappe.permissions import (
add_user_permission,
get_doc_permissions,
has_permission,
remove_user_permission,
set_user_permission_if_allowed,
)
from frappe.utils import add_years, cstr, getdate, today, validate_email_address
from frappe.utils.nestedset import NestedSet
from erpnext.utilities.transaction_base import delete_events
class EmployeeUserDisabledError(frappe.ValidationError):
pass
class InactiveEmployeeStatusError(frappe.ValidationError):

View File

@@ -1,6 +1,8 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'heatmap': True,

View File

@@ -3,10 +3,12 @@
import frappe
from frappe import _
from frappe.utils import comma_sep, getdate, today, add_months, add_days
from frappe.utils import add_days, add_months, comma_sep, getdate, today
from erpnext.hr.doctype.employee.employee import get_all_employee_emails, get_employee_email
from erpnext.hr.utils import get_holidays_for_employee
# -----------------
# HOLIDAY REMINDERS
# -----------------

View File

@@ -1,10 +1,12 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
import erpnext
import unittest
import frappe
import frappe.utils
import erpnext
from erpnext.hr.doctype.employee.employee import InactiveEmployeeStatusError
test_records = frappe.get_test_records('Employee')
@@ -23,9 +25,9 @@ class TestEmployee(unittest.TestCase):
self.assertRaises(InactiveEmployeeStatusError, employee1_doc.save)
def test_employee_status_inactive(self):
from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure
from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip
from erpnext.payroll.doctype.salary_slip.test_salary_slip import make_holiday_list
from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip
from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure
employee = make_employee("test_employee_status@company.com")
employee_doc = frappe.get_doc("Employee", employee)

View File

@@ -1,11 +1,12 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
import unittest
from frappe.utils import getdate
from datetime import timedelta
import frappe
from frappe.utils import getdate
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.hr.doctype.hr_settings.hr_settings import set_proceed_with_frequency_change
@@ -84,7 +85,10 @@ class TestEmployeeReminders(unittest.TestCase):
employee.company = "_Test Company"
employee.save()
from erpnext.hr.doctype.employee.employee_reminders import get_employees_who_are_born_today, send_birthday_reminders
from erpnext.hr.doctype.employee.employee_reminders import (
get_employees_who_are_born_today,
send_birthday_reminders,
)
employees_born_today = get_employees_who_are_born_today()
self.assertTrue(employees_born_today.get("_Test Company"))
@@ -105,7 +109,10 @@ class TestEmployeeReminders(unittest.TestCase):
employee.company = "_Test Company"
employee.save()
from erpnext.hr.doctype.employee.employee_reminders import get_employees_having_an_event_today, send_work_anniversary_reminders
from erpnext.hr.doctype.employee.employee_reminders import (
get_employees_having_an_event_today,
send_work_anniversary_reminders,
)
employees_having_work_anniversary = get_employees_having_an_event_today('work_anniversary')
self.assertTrue(employees_having_work_anniversary.get("_Test Company"))
@@ -120,8 +127,8 @@ class TestEmployeeReminders(unittest.TestCase):
self.assertTrue("Subject: Work Anniversary Reminder" in email_queue[0].message)
def test_send_holidays_reminder_in_advance(self):
from erpnext.hr.utils import get_holidays_for_employee
from erpnext.hr.doctype.employee.employee_reminders import send_holidays_reminder_in_advance
from erpnext.hr.utils import get_holidays_for_employee
# Get HR settings and enable advance holiday reminders
hr_settings = frappe.get_doc("HR Settings", "HR Settings")
@@ -147,6 +154,7 @@ class TestEmployeeReminders(unittest.TestCase):
def test_advance_holiday_reminders_monthly(self):
from erpnext.hr.doctype.employee.employee_reminders import send_reminders_in_advance_monthly
# Get HR settings and enable advance holiday reminders
hr_settings = frappe.get_doc("HR Settings", "HR Settings")
hr_settings.send_holiday_reminders = 1
@@ -161,6 +169,7 @@ class TestEmployeeReminders(unittest.TestCase):
def test_advance_holiday_reminders_weekly(self):
from erpnext.hr.doctype.employee.employee_reminders import send_reminders_in_advance_weekly
# Get HR settings and enable advance holiday reminders
hr_settings = frappe.get_doc("HR Settings", "HR Settings")
hr_settings.send_holiday_reminders = 1

View File

@@ -3,13 +3,17 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, erpnext
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt, nowdate
import erpnext
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
from erpnext.hr.utils import validate_active_employee
class EmployeeAdvanceOverPayment(frappe.ValidationError):
pass

View File

@@ -1,5 +1,5 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return {

View File

@@ -3,12 +3,18 @@
# See license.txt
from __future__ import unicode_literals
import frappe, erpnext
import unittest
import frappe
from frappe.utils import nowdate
from erpnext.hr.doctype.employee_advance.employee_advance import make_bank_entry
from erpnext.hr.doctype.employee_advance.employee_advance import EmployeeAdvanceOverPayment
import erpnext
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.hr.doctype.employee_advance.employee_advance import (
EmployeeAdvanceOverPayment,
make_bank_entry,
)
class TestEmployeeAdvance(unittest.TestCase):
def test_paid_amount_and_status(self):

View File

@@ -3,8 +3,10 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
import frappe
from frappe.model.document import Document
from frappe.utils import getdate

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class EmployeeBoardingActivity(Document):
pass

View File

@@ -3,14 +3,18 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import now, cint, get_datetime
from frappe.model.document import Document
from frappe import _
from erpnext.hr.doctype.shift_assignment.shift_assignment import get_actual_start_end_datetime_of_shift
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import cint, get_datetime
from erpnext.hr.doctype.shift_assignment.shift_assignment import (
get_actual_start_end_datetime_of_shift,
)
from erpnext.hr.utils import validate_active_employee
class EmployeeCheckin(Document):
def validate(self):
validate_active_employee(self.employee)

View File

@@ -3,13 +3,19 @@
# See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import now_datetime, nowdate, to_timedelta
import unittest
from datetime import timedelta
from erpnext.hr.doctype.employee_checkin.employee_checkin import add_log_based_on_employee_field, mark_attendance_and_link_log, calculate_working_hours
import frappe
from frappe.utils import now_datetime, nowdate
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.hr.doctype.employee_checkin.employee_checkin import (
add_log_based_on_employee_field,
calculate_working_hours,
mark_attendance_and_link_log,
)
class TestEmployeeCheckin(unittest.TestCase):
def test_add_log_based_on_employee_field(self):

View File

@@ -2,9 +2,9 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class EmployeeEducation(Document):
pass

View File

@@ -2,9 +2,9 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class EmployeeExternalWorkHistory(Document):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class EmployeeGrade(Document):
pass

View File

@@ -1,5 +1,6 @@
from __future__ import unicode_literals
def get_data():
return {
'transactions': [

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestEmployeeGrade(unittest.TestCase):
pass

View File

@@ -5,6 +5,7 @@ import frappe
from frappe import _, bold
from frappe.model.document import Document
class EmployeeGrievance(Document):
def on_submit(self):
if self.status not in ["Invalid", "Resolved"]:

View File

@@ -1,10 +1,14 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import frappe
import unittest
import frappe
from frappe.utils import today
from erpnext.hr.doctype.employee.test_employee import make_employee
class TestEmployeeGrievance(unittest.TestCase):
def test_create_employee_grievance(self):
create_employee_grievance()

View File

@@ -3,7 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class EmployeeGroup(Document):
pass

View File

@@ -2,10 +2,14 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe
from erpnext.hr.doctype.employee.test_employee import make_employee
class TestEmployeeGroup(unittest.TestCase):
pass

View File

@@ -3,7 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class EmployeeGroupTable(Document):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class EmployeeHealthInsurance(Document):
pass

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestEmployeeHealthInsurance(unittest.TestCase):
pass

View File

@@ -2,9 +2,9 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class EmployeeInternalWorkHistory(Document):
pass

View File

@@ -3,11 +3,14 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.controllers.employee_boarding_controller import EmployeeBoardingController
from frappe.model.mapper import get_mapped_doc
from erpnext.controllers.employee_boarding_controller import EmployeeBoardingController
class IncompleteTaskError(frappe.ValidationError): pass
class EmployeeOnboarding(EmployeeBoardingController):

View File

@@ -3,13 +3,18 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe
from frappe.utils import getdate
from erpnext.hr.doctype.employee_onboarding.employee_onboarding import make_employee
from erpnext.payroll.doctype.salary_slip.test_salary_slip import make_holiday_list
from erpnext.hr.doctype.employee_onboarding.employee_onboarding import IncompleteTaskError
from erpnext.hr.doctype.employee_onboarding.employee_onboarding import (
IncompleteTaskError,
make_employee,
)
from erpnext.hr.doctype.job_offer.test_job_offer import create_job_offer
from erpnext.payroll.doctype.salary_slip.test_salary_slip import make_holiday_list
class TestEmployeeOnboarding(unittest.TestCase):
def setUp(self):

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class EmployeeOnboardingTemplate(Document):
pass

View File

@@ -1,5 +1,5 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return {

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestEmployeeOnboardingTemplate(unittest.TestCase):
pass

View File

@@ -3,12 +3,15 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import getdate
from erpnext.hr.utils import update_employee, validate_active_employee
class EmployeePromotion(Document):
def validate(self):
validate_active_employee(self.employee)

View File

@@ -3,11 +3,14 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import getdate, add_days
import frappe
from frappe.utils import add_days, getdate
from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_employee
class TestEmployeePromotion(unittest.TestCase):
def setUp(self):
self.employee = make_employee("employee@promotions.com")

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class EmployeePropertyHistory(Document):
pass

View File

@@ -3,12 +3,15 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import get_link_to_form
from frappe.model.document import Document
from frappe.utils import get_link_to_form
from erpnext.hr.utils import validate_active_employee
class EmployeeReferral(Document):
def validate(self):
validate_active_employee(self.referrer)
@@ -56,6 +59,7 @@ def create_job_applicant(source_name, target_doc=None):
@frappe.whitelist()
def create_additional_salary(doc):
import json
from six import string_types
if isinstance(doc, string_types):

View File

@@ -1,5 +1,6 @@
from __future__ import unicode_literals
def get_data():
return {
'fieldname': 'employee_referral',

View File

@@ -3,12 +3,18 @@
# See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import today
from erpnext.hr.doctype.designation.test_designation import create_designation
from erpnext.hr.doctype.employee_referral.employee_referral import create_job_applicant, create_additional_salary
from erpnext.hr.doctype.employee.test_employee import make_employee
import unittest
from erpnext.hr.doctype.employee_referral.employee_referral import (
create_additional_salary,
create_job_applicant,
)
class TestEmployeeReferral(unittest.TestCase):
def test_workflow_and_status_sync(self):

View File

@@ -3,8 +3,10 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from erpnext.controllers.employee_boarding_controller import EmployeeBoardingController
class EmployeeSeparation(EmployeeBoardingController):
def validate(self):
super(EmployeeSeparation, self).validate()

View File

@@ -3,9 +3,10 @@
# See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import getdate
import unittest
test_dependencies = ['Employee Onboarding']

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class EmployeeSeparationTemplate(Document):
pass

View File

@@ -1,5 +1,5 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return {

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestEmployeeSeparationTemplate(unittest.TestCase):
pass

View File

@@ -3,8 +3,10 @@
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class EmployeeSkill(Document):
pass

View File

@@ -3,8 +3,10 @@
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class EmployeeSkillMap(Document):
pass

View File

@@ -3,8 +3,10 @@
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class EmployeeTraining(Document):
pass

View File

@@ -3,12 +3,15 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import getdate
from erpnext.hr.utils import update_employee
class EmployeeTransfer(Document):
def before_submit(self):
if getdate(self.transfer_date) > getdate():

View File

@@ -3,11 +3,14 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import getdate, add_days
import frappe
from frappe.utils import add_days, getdate
from erpnext.hr.doctype.employee.test_employee import make_employee
class TestEmployeeTransfer(unittest.TestCase):
def setUp(self):
make_employee("employee2@transfers.com")

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class EmployeeTransferProperty(Document):
pass

View File

@@ -3,8 +3,8 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestEmployeeTransferProperty(unittest.TestCase):
pass

View File

@@ -2,9 +2,9 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class EmploymentType(Document):
pass

View File

@@ -2,6 +2,6 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
test_records = frappe.get_test_records('Employment Type')

View File

@@ -2,17 +2,17 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, erpnext
import frappe
from frappe import _
from frappe.utils import get_fullname, flt, cstr, get_link_to_form
from frappe.model.document import Document
from erpnext.hr.utils import set_employee_name, share_doc_with_approver, validate_active_employee
from erpnext.accounts.party import get_party_account
from erpnext.accounts.general_ledger import make_gl_entries
from frappe.utils import cstr, flt, get_link_to_form
import erpnext
from erpnext.accounts.doctype.sales_invoice.sales_invoice import get_bank_cash_account
from erpnext.accounts.general_ledger import make_gl_entries
from erpnext.controllers.accounts_controller import AccountsController
from frappe.utils.csvutils import getlink
from erpnext.accounts.utils import get_account_currency
from erpnext.hr.utils import set_employee_name, share_doc_with_approver, validate_active_employee
class InvalidExpenseApproverError(frappe.ValidationError): pass
class ExpenseApproverIdentityError(frappe.ValidationError): pass

View File

@@ -1,6 +1,8 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'reference_name',

View File

@@ -2,12 +2,14 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import random_string, nowdate, flt
from erpnext.hr.doctype.expense_claim.expense_claim import make_bank_entry
import frappe
from frappe.utils import flt, nowdate, random_string
from erpnext.accounts.doctype.account.test_account import create_account
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.hr.doctype.expense_claim.expense_claim import make_bank_entry
test_records = frappe.get_test_records('Expense Claim')
test_dependencies = ['Employee']

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ExpenseClaimAccount(Document):
pass

View File

@@ -3,8 +3,9 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ExpenseClaimAdvance(Document):
pass

View File

@@ -2,9 +2,9 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ExpenseClaimDetail(Document):
pass

View File

@@ -2,10 +2,12 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
class ExpenseClaimType(Document):
def validate(self):
self.validate_accounts()

View File

@@ -3,7 +3,6 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Expense Claim Type')

View File

@@ -3,8 +3,10 @@
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class ExpenseTaxesandCharges(Document):
pass

View File

@@ -4,5 +4,6 @@
# import frappe
from frappe.model.document import Document
class FullandFinalAsset(Document):
pass

View File

@@ -4,5 +4,6 @@
# import frappe
import unittest
class TestFullandFinalAsset(unittest.TestCase):
pass

View File

@@ -4,5 +4,6 @@
# import frappe
from frappe.model.document import Document
class FullandFinalOutstandingStatement(Document):
pass

View File

@@ -3,8 +3,9 @@
import frappe
from frappe import _
from frappe.utils import get_link_to_form, today, flt
from frappe.model.document import Document
from frappe.utils import flt, get_link_to_form, today
class FullandFinalStatement(Document):
def validate(self):

View File

@@ -1,13 +1,16 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import frappe
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.assets.doctype.asset.test_asset import create_asset_data
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
from frappe.utils import today, add_days
import unittest
import frappe
from frappe.utils import add_days, today
from erpnext.assets.doctype.asset.test_asset import create_asset_data
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
class TestFullandFinalStatement(unittest.TestCase):
def setUp(self):

View File

@@ -4,5 +4,6 @@
# import frappe
from frappe.model.document import Document
class GrievanceType(Document):
pass

Some files were not shown because too many files have changed in this diff Show More