mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 05:09:11 +00:00
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:
@@ -4,15 +4,13 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import urllib
|
||||
from collections import Counter
|
||||
from datetime import timedelta
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import get_url, getdate
|
||||
from frappe.utils.verified_command import verify_request, get_signed_params
|
||||
from frappe.utils.verified_command import get_signed_params
|
||||
|
||||
|
||||
class Appointment(Document):
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
import datetime
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
|
||||
|
||||
def create_test_lead():
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import datetime
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
import datetime
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestAppointmentBookingSettings(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -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 AppointmentBookingSlots(Document):
|
||||
pass
|
||||
|
||||
@@ -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 AvailabilityOfSlots(Document):
|
||||
pass
|
||||
|
||||
@@ -5,6 +5,7 @@ import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.naming import set_name_by_naming_series
|
||||
|
||||
|
||||
class Campaign(Document):
|
||||
def autoname(self):
|
||||
if frappe.defaults.get_global_default('campaign_naming_by') != 'Naming Series':
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestCampaign(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -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 CampaignEmailSchedule(Document):
|
||||
pass
|
||||
|
||||
@@ -7,7 +7,7 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import getdate, now_datetime, nowdate
|
||||
from frappe.utils import getdate, nowdate
|
||||
|
||||
|
||||
class Contract(Document):
|
||||
|
||||
@@ -8,6 +8,7 @@ import unittest
|
||||
import frappe
|
||||
from frappe.utils import add_days, nowdate
|
||||
|
||||
|
||||
class TestContract(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
||||
@@ -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 ContractFulfilmentChecklist(Document):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestContractFulfilmentChecklist(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,11 +3,14 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils.jinja import validate_template
|
||||
from six import string_types
|
||||
import json
|
||||
|
||||
|
||||
class ContractTemplate(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestContractTemplate(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -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 ContractTemplateFulfilmentTerms(Document):
|
||||
pass
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import getdate, add_days, today, nowdate, cstr
|
||||
from frappe.model.document import Document
|
||||
from frappe.core.doctype.communication.email import make
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import add_days, getdate, today
|
||||
|
||||
|
||||
class EmailCampaign(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestEmailCampaign(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -4,13 +4,23 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from erpnext.accounts.party import set_taxes
|
||||
from erpnext.controllers.selling_controller import SellingController
|
||||
from frappe import _
|
||||
from frappe.contacts.address_and_contact import load_address_and_contact
|
||||
from frappe.email.inbox import link_communication_to_document
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from frappe.utils import cint, comma_and, cstr, getdate, has_gravatar, nowdate, validate_email_address
|
||||
from frappe.utils import (
|
||||
cint,
|
||||
comma_and,
|
||||
cstr,
|
||||
getdate,
|
||||
has_gravatar,
|
||||
nowdate,
|
||||
validate_email_address,
|
||||
)
|
||||
|
||||
from erpnext.accounts.party import set_taxes
|
||||
from erpnext.controllers.selling_controller import SellingController
|
||||
|
||||
|
||||
class Lead(SellingController):
|
||||
def get_feed(self):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.utils import random_string
|
||||
import unittest
|
||||
|
||||
test_records = frappe.get_test_records('Lead')
|
||||
|
||||
|
||||
@@ -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 LeadSource(Document):
|
||||
pass
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestLeadSource(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,14 +3,16 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import requests
|
||||
from frappe import _
|
||||
from frappe.utils import get_url_to_form
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import get_url_to_form
|
||||
from frappe.utils.file_manager import get_file_path
|
||||
from six.moves.urllib.parse import urlencode
|
||||
|
||||
|
||||
class LinkedInSettings(Document):
|
||||
@frappe.whitelist()
|
||||
def get_authorization_url(self):
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestLinkedInSettings(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class LostReasonDetail(Document):
|
||||
pass
|
||||
|
||||
@@ -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 MarketSegment(Document):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestMarketSegment(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -2,14 +2,19 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, json
|
||||
from frappe.utils import cstr, cint, get_fullname
|
||||
from frappe import msgprint, _
|
||||
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.email.inbox import link_communication_to_document
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from frappe.utils import cint, cstr, get_fullname
|
||||
|
||||
from erpnext.accounts.party import get_party_account_currency
|
||||
from erpnext.setup.utils import get_exchange_rate
|
||||
from erpnext.utilities.transaction_base import TransactionBase
|
||||
from erpnext.accounts.party import get_party_account_currency
|
||||
from frappe.email.inbox import link_communication_to_document
|
||||
|
||||
|
||||
class Opportunity(TransactionBase):
|
||||
def after_insert(self):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.utils import today, random_string
|
||||
from frappe.utils import random_string, today
|
||||
|
||||
from erpnext.crm.doctype.lead.lead import make_customer
|
||||
from erpnext.crm.doctype.opportunity.opportunity import make_quotation
|
||||
import unittest
|
||||
|
||||
test_records = frappe.get_test_records('Opportunity')
|
||||
|
||||
|
||||
@@ -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 OpportunityItem(Document):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class OpportunityLostReason(Document):
|
||||
pass
|
||||
|
||||
@@ -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 OpportunityLostReasonDetail(Document):
|
||||
pass
|
||||
|
||||
@@ -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 OpportunityType(Document):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestOpportunityType(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
import frappe
|
||||
from frappe.contacts.address_and_contact import load_address_and_contact
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from frappe.contacts.address_and_contact import load_address_and_contact
|
||||
|
||||
|
||||
class Prospect(Document):
|
||||
def onload(self):
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.utils import random_string
|
||||
from erpnext.crm.doctype.lead.test_lead import make_lead
|
||||
|
||||
from erpnext.crm.doctype.lead.lead import add_lead_to_prospect
|
||||
from erpnext.crm.doctype.lead.test_lead import make_lead
|
||||
|
||||
|
||||
class TestProspect(unittest.TestCase):
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class ProspectLead(Document):
|
||||
pass
|
||||
|
||||
@@ -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 SalesStage(Document):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestSalesStage(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,11 +3,14 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe import _
|
||||
|
||||
import datetime
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class SocialMediaPost(Document):
|
||||
def validate(self):
|
||||
if (not self.twitter and not self.linkedin):
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestSocialMediaPost(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestTwitterSettings(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,13 +3,18 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, os, tweepy, json
|
||||
|
||||
import json
|
||||
|
||||
import frappe
|
||||
import tweepy
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import get_url_to_form
|
||||
from frappe.utils.file_manager import get_file_path
|
||||
from frappe.utils import get_url_to_form, get_link_to_form
|
||||
from tweepy.error import TweepError
|
||||
|
||||
|
||||
class TwitterSettings(Document):
|
||||
@frappe.whitelist()
|
||||
def get_authorize_url(self):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
import json
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_last_interaction(contact=None, lead=None):
|
||||
|
||||
@@ -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 = [], []
|
||||
columns=get_columns("Campaign Name")
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
columns = [
|
||||
{
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _, msgprint
|
||||
from frappe.utils import date_diff, flt
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
if not filters: filters = {}
|
||||
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
columns, data = get_columns(), get_data(filters)
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
from frappe import _
|
||||
|
||||
from erpnext.crm.report.campaign_efficiency.campaign_efficiency import get_lead_data
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
columns, data = [], []
|
||||
columns=get_columns()
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
columns, data = get_columns(), get_data(filters)
|
||||
|
||||
@@ -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 add_days, now
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
columns, data = [], []
|
||||
set_defaut_value_for_filters(filters)
|
||||
|
||||
Reference in New Issue
Block a user