mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 23:52:57 +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:
@@ -2,16 +2,20 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import throw, _
|
||||
import frappe.defaults
|
||||
from frappe.utils import cint, flt, get_fullname, cstr
|
||||
from frappe import _, throw
|
||||
from frappe.contacts.doctype.address.address import get_address_display
|
||||
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import get_shopping_cart_settings
|
||||
from frappe.utils.nestedset import get_root_of
|
||||
from erpnext.accounts.utils import get_account_name
|
||||
from erpnext.utilities.product import get_qty_in_stock
|
||||
from frappe.contacts.doctype.contact.contact import get_contact_name
|
||||
from frappe.utils import cint, cstr, flt, get_fullname
|
||||
from frappe.utils.nestedset import get_root_of
|
||||
|
||||
from erpnext.accounts.utils import get_account_name
|
||||
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import (
|
||||
get_shopping_cart_settings,
|
||||
)
|
||||
from erpnext.utilities.product import get_qty_in_stock
|
||||
|
||||
|
||||
class WebsitePriceListMissingError(frappe.ValidationError):
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _, msgprint
|
||||
from frappe.utils import flt
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import get_datetime, get_datetime_str, now_datetime
|
||||
from frappe.utils import flt
|
||||
|
||||
|
||||
class ShoppingCartSetupError(frappe.ValidationError): pass
|
||||
|
||||
|
||||
@@ -4,9 +4,15 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
import unittest
|
||||
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import ShoppingCartSetupError
|
||||
|
||||
import frappe
|
||||
|
||||
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import (
|
||||
ShoppingCartSetupError,
|
||||
)
|
||||
|
||||
|
||||
class TestShoppingCartSettings(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _dict
|
||||
|
||||
|
||||
class ProductFiltersBuilder:
|
||||
def __init__(self, item_group=None):
|
||||
if not item_group or item_group == "Products Settings":
|
||||
|
||||
@@ -4,10 +4,14 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
from erpnext.shopping_cart.cart import _get_cart_quotation, _set_price_list
|
||||
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings \
|
||||
import get_shopping_cart_settings, show_quantity_in_website
|
||||
from erpnext.utilities.product import get_price, get_qty_in_stock, get_non_stock_item_status
|
||||
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import (
|
||||
get_shopping_cart_settings,
|
||||
show_quantity_in_website,
|
||||
)
|
||||
from erpnext.utilities.product import get_non_stock_item_status, get_price, get_qty_in_stock
|
||||
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def get_product_info_for_website(item_code, skip_quotation_creation=False):
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
import frappe
|
||||
|
||||
from erpnext.shopping_cart.product_info import get_product_info_for_website
|
||||
|
||||
|
||||
class ProductQuery:
|
||||
"""Query engine for product listing
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import frappe
|
||||
from frappe.search.full_text_search import FullTextSearch
|
||||
from whoosh.fields import TEXT, ID, KEYWORD, Schema
|
||||
from frappe.utils import strip_html_tags
|
||||
from whoosh.qparser import MultifieldParser, FieldsPlugin, WildcardPlugin
|
||||
from whoosh.analysis import StemmingAnalyzer
|
||||
from whoosh.fields import ID, KEYWORD, TEXT, Schema
|
||||
from whoosh.qparser import FieldsPlugin, MultifieldParser, WildcardPlugin
|
||||
from whoosh.query import Prefix
|
||||
|
||||
INDEX_NAME = "products"
|
||||
|
||||
@@ -2,12 +2,15 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.utils import nowdate, add_months
|
||||
from erpnext.shopping_cart.cart import _get_cart_quotation, update_cart, get_party
|
||||
from frappe.utils import add_months, nowdate
|
||||
|
||||
from erpnext.accounts.doctype.tax_rule.tax_rule import ConflictingTaxRule
|
||||
from erpnext.shopping_cart.cart import _get_cart_quotation, get_party, update_cart
|
||||
from erpnext.tests.utils import create_test_contact_and_address
|
||||
from erpnext.accounts.doctype.tax_rule.tax_rule import ConflictingTaxRule
|
||||
|
||||
# test_dependencies = ['Payment Terms Template']
|
||||
|
||||
|
||||
@@ -4,8 +4,11 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import frappe.defaults
|
||||
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import is_cart_enabled
|
||||
|
||||
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import (
|
||||
is_cart_enabled,
|
||||
)
|
||||
|
||||
|
||||
def show_cart_count():
|
||||
if (is_cart_enabled() and
|
||||
|
||||
Reference in New Issue
Block a user