chore: Cleanup imports (#27320)

* chore: Added isort to pre-commit config

* chore: Sort imports with isort

* chore: Remove imports with pycln

* chore: Sort imports with isort

* chore: Fix import issues

* chore: Fix sider issues

* chore: linting

* chore: linting / sorting import

from ecommerce refactor merge

* ci: dont allow unused imports

* chore: sort / clean ecommerce imports

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
This commit is contained in:
Chillar Anand
2021-09-03 18:57:43 +05:30
committed by GitHub
parent 910b9bc3f4
commit 4b2be2999f
2103 changed files with 7844 additions and 3106 deletions

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 DuplicationError(frappe.ValidationError): pass
class ActivityCost(Document):

View File

@@ -3,11 +3,13 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe
from erpnext.projects.doctype.activity_cost.activity_cost import DuplicationError
class TestActivityCost(unittest.TestCase):
def test_duplication(self):
frappe.db.sql("delete from `tabActivity Cost`")

View File

@@ -2,7 +2,9 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class ActivityType(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('Activity Type')

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 DependentTask(Document):
pass

View File

@@ -2,18 +2,19 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from six import iteritems
from email_reply_parser import EmailReplyParser
from frappe.utils import (flt, getdate, get_url, now,
nowtime, get_time, today, get_datetime, add_days)
from erpnext.controllers.queries import get_filters_cond
from frappe import _
from frappe.desk.reportview import get_match_cond
from frappe.model.document import Document
from frappe.utils import add_days, flt, get_datetime, get_time, get_url, nowtime, today
from erpnext.controllers.queries import get_filters_cond
from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list
from erpnext.hr.doctype.daily_work_summary.daily_work_summary import get_users_email
from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday
from frappe.model.document import Document
from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list
class Project(Document):
def get_feed(self):

View File

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

View File

@@ -2,9 +2,10 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe, unittest
from frappe.utils import getdate, nowdate, add_days
import frappe
from frappe.utils import add_days, getdate, nowdate
from erpnext.projects.doctype.project_template.test_project_template import make_project_template
from erpnext.projects.doctype.task.test_task import create_task

View File

@@ -3,11 +3,13 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
from frappe.model.document import Document
from frappe.utils import get_link_to_form
class ProjectTemplate(Document):
def validate(self):

View File

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

View File

@@ -3,10 +3,13 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe
from erpnext.projects.doctype.task.test_task import create_task
class TestProjectTemplate(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 ProjectTemplateTask(Document):
pass

View File

@@ -3,9 +3,11 @@
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
import frappe
from frappe import _
from frappe.model.document import Document
class ProjectType(Document):
def on_trash(self):

View File

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

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 ProjectUpdate(Document):
pass

View File

@@ -3,9 +3,11 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import frappe
class TestProjectUpdate(unittest.TestCase):
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 ProjectUser(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 ProjectsSettings(Document):
pass

View File

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

View File

@@ -9,7 +9,7 @@ import frappe
from frappe import _, throw
from frappe.desk.form.assign_to import clear, close_all_assignments
from frappe.model.mapper import get_mapped_doc
from frappe.utils import add_days, cstr, date_diff, get_link_to_form, getdate, today, flt
from frappe.utils import add_days, cstr, date_diff, flt, get_link_to_form, getdate, today
from frappe.utils.nestedset import NestedSet

View File

@@ -1,12 +1,15 @@
# 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
from frappe.utils import getdate, nowdate, add_days
import frappe
from frappe.utils import add_days, getdate, nowdate
from erpnext.projects.doctype.task.task import CircularReferenceError
class TestTask(unittest.TestCase):
def test_circular_reference(self):
task1 = create_task("_Test Task 1", add_days(nowdate(), -15), add_days(nowdate(), -10))

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 TaskDependsOn(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 TaskType(Document):
pass

View File

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

View File

@@ -3,21 +3,28 @@
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
import datetime
from frappe.utils.make_random import get_random
from frappe.utils import now_datetime, nowdate, add_days, add_months
from erpnext.projects.doctype.timesheet.timesheet import OverlapError
from erpnext.projects.doctype.timesheet.timesheet import make_salary_slip, make_sales_invoice
import unittest
import frappe
from frappe.utils import add_months, now_datetime, nowdate
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.payroll.doctype.salary_structure.test_salary_structure \
import make_salary_structure, create_salary_structure_assignment
from erpnext.payroll.doctype.salary_slip.test_salary_slip import (
make_earning_salary_component,
make_deduction_salary_component
)
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.payroll.doctype.salary_slip.test_salary_slip import (
make_deduction_salary_component,
make_earning_salary_component,
)
from erpnext.payroll.doctype.salary_structure.test_salary_structure import (
create_salary_structure_assignment,
make_salary_structure,
)
from erpnext.projects.doctype.timesheet.timesheet import (
OverlapError,
make_salary_slip,
make_sales_invoice,
)
class TestTimesheet(unittest.TestCase):
@classmethod

View File

@@ -3,19 +3,18 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
import json
from datetime import timedelta
from erpnext.controllers.queries import get_match_cond
from frappe.utils import flt, time_diff_in_hours, get_datetime, getdate, cint, date_diff, add_to_date
import frappe
from frappe import _
from frappe.model.document import Document
from erpnext.manufacturing.doctype.workstation.workstation import (check_if_within_operating_hours,
WorkstationHolidayError)
from erpnext.manufacturing.doctype.manufacturing_settings.manufacturing_settings import get_mins_between_operations
from erpnext.setup.utils import get_exchange_rate
from frappe.utils import flt, getdate, time_diff_in_hours
from erpnext.controllers.queries import get_match_cond
from erpnext.hr.utils import validate_active_employee
from erpnext.setup.utils import get_exchange_rate
class OverlapError(frappe.ValidationError): pass
class OverWorkLoggedError(frappe.ValidationError): pass

View File

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

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 TimesheetDetail(Document):
pass

View File

@@ -3,9 +3,11 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import time_diff_in_hours, flt
from frappe.utils import flt, time_diff_in_hours
def get_columns():
return [

View File

@@ -2,10 +2,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.desk.reportview import build_match_conditions
def execute(filters=None):
if not filters:
filters = {}

View File

@@ -2,9 +2,11 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import date_diff, nowdate
def execute(filters=None):
columns, data = [], []
data = get_data(filters)

View File

@@ -1,10 +1,14 @@
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import nowdate, add_days, add_months
from frappe.utils import add_days, add_months, nowdate
from erpnext.projects.doctype.task.test_task import create_task
from erpnext.projects.report.delayed_tasks_summary.delayed_tasks_summary import execute
class TestDelayedTasksSummary(unittest.TestCase):
@classmethod
def setUp(self):

View File

@@ -2,10 +2,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.projects.report.billing_summary import get_columns, get_data
def execute(filters=None):
filters = frappe._dict(filters or {})
columns = get_columns()

View File

@@ -2,11 +2,13 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, getdate
from six import iteritems
def execute(filters=None):
return EmployeeHoursReport(filters).run()

View File

@@ -1,11 +1,16 @@
from __future__ import unicode_literals
import unittest
import frappe
import unittest
import frappe
from frappe.utils.make_random import get_random
from erpnext.projects.report.employee_hours_utilization_based_on_timesheet.employee_hours_utilization_based_on_timesheet import execute
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.projects.doctype.project.test_project import make_project
from erpnext.projects.report.employee_hours_utilization_based_on_timesheet.employee_hours_utilization_based_on_timesheet import (
execute,
)
class TestEmployeeUtilization(unittest.TestCase):
@classmethod

View File

@@ -2,10 +2,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.projects.report.billing_summary import get_columns, get_data
def execute(filters=None):
filters = frappe._dict(filters or {})
columns = get_columns()

View File

@@ -2,10 +2,12 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
def execute(filters=None):
columns, data = [], []
data = get_data(filters)

View File

@@ -1,12 +1,19 @@
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import getdate, nowdate, add_days
from frappe.utils import add_days, getdate, nowdate
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.projects.doctype.timesheet.test_timesheet import make_salary_structure_for_timesheet, make_timesheet
from erpnext.projects.doctype.timesheet.test_timesheet import (
make_salary_structure_for_timesheet,
make_timesheet,
)
from erpnext.projects.doctype.timesheet.timesheet import make_salary_slip, make_sales_invoice
from erpnext.projects.report.project_profitability.project_profitability import execute
class TestProjectProfitability(unittest.TestCase):
def setUp(self):

View File

@@ -2,9 +2,11 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns = get_columns()
data = []

View File

@@ -5,6 +5,7 @@ from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns = get_columns()
proj_details = get_project_details()

View File

@@ -4,8 +4,10 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def query_task(doctype, txt, searchfield, start, page_len, filters):

View File

@@ -2,6 +2,7 @@ from __future__ import unicode_literals
import frappe
def get_context(context):
if frappe.form_dict.project:
context.parents = [{'title': frappe.form_dict.project, 'route': '/projects?project='+ frappe.form_dict.project}]