diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56c9fed..c909997 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,6 +30,12 @@ repos: hooks: - id: black + - repo: https://github.com/PyCQA/autoflake + rev: v2.3.1 + hooks: + - id: autoflake + args: [--remove-all-unused-imports, --in-place] + - repo: https://github.com/PyCQA/flake8 rev: 7.1.1 hooks: diff --git a/inventory_tools/hooks.py b/inventory_tools/hooks.py index 1d0d119..3cba4bb 100644 --- a/inventory_tools/hooks.py +++ b/inventory_tools/hooks.py @@ -1,7 +1,6 @@ # Copyright (c) 2024, AgriTheory and contributors # For license information, please see license.txt -from . import __version__ as app_version app_name = "inventory_tools" app_title = "Inventory Tools" diff --git a/inventory_tools/inventory_tools/custom/workstation.json b/inventory_tools/inventory_tools/custom/workstation.json new file mode 100644 index 0000000..12239df --- /dev/null +++ b/inventory_tools/inventory_tools/custom/workstation.json @@ -0,0 +1,58 @@ +{ + "custom_fields": [ + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "creation": "2024-08-20 05:01:28.504010", + "default": null, + "docstatus": 0, + "dt": "Workstation", + "fetch_if_empty": 0, + "fieldname": "company", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 5, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 1, + "insert_after": "workstation_type", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Company", + "length": 0, + "modified": "2024-08-20 05:01:28.504010", + "modified_by": "Administrator", + "name": "Workstation-company", + "no_copy": 0, + "non_negative": 0, + "options": "Company", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0 + } + ], + "custom_perms": [], + "doctype": "Workstation", + "links": [], + "property_setters": [], + "sync_on_migrate": 1 +} diff --git a/inventory_tools/inventory_tools/custom/workstation_working_hour.json b/inventory_tools/inventory_tools/custom/workstation_working_hour.json index 9e49136..6fb92de 100644 --- a/inventory_tools/inventory_tools/custom/workstation_working_hour.json +++ b/inventory_tools/inventory_tools/custom/workstation_working_hour.json @@ -29,7 +29,7 @@ "is_virtual": 0, "label": "Shift Type", "length": 0, - "modified": "2024-07-13 09:28:11.750725", + "modified": "2024-08-20 04:59:56.712644", "modified_by": "Administrator", "module": "Inventory Tools", "name": "Workstation Working Hour-shift_type", diff --git a/inventory_tools/inventory_tools/doctype/alternative_workstation/alternative_workstation.py b/inventory_tools/inventory_tools/doctype/alternative_workstation/alternative_workstation.py index 581d755..b4d8274 100644 --- a/inventory_tools/inventory_tools/doctype/alternative_workstation/alternative_workstation.py +++ b/inventory_tools/inventory_tools/doctype/alternative_workstation/alternative_workstation.py @@ -1,7 +1,6 @@ # Copyright (c) 2024, AgriTheory and contributors # For license information, please see license.txt -import frappe from frappe.model.document import Document diff --git a/inventory_tools/inventory_tools/faceted_search.py b/inventory_tools/inventory_tools/faceted_search.py index b8c8872..96443e9 100644 --- a/inventory_tools/inventory_tools/faceted_search.py +++ b/inventory_tools/inventory_tools/faceted_search.py @@ -7,7 +7,6 @@ import frappe from webshop.webshop.api import get_product_filter_data as webshop_get_product_filter_data from webshop.webshop.product_data_engine.filters import ProductFiltersBuilder -from webshop.webshop.product_data_engine.query import ProductQuery from webshop.webshop.doctype.override_doctype.item_group import get_child_groups_for_website from frappe.utils.data import cint, flt, getdate diff --git a/inventory_tools/inventory_tools/overrides/production_plan.py b/inventory_tools/inventory_tools/overrides/production_plan.py index fae8735..c7859d2 100644 --- a/inventory_tools/inventory_tools/overrides/production_plan.py +++ b/inventory_tools/inventory_tools/overrides/production_plan.py @@ -2,8 +2,6 @@ # For license information, please see license.txt -import json - import frappe from frappe import _ from erpnext.manufacturing.doctype.production_plan.production_plan import ProductionPlan diff --git a/inventory_tools/inventory_tools/overrides/purchase_invoice.py b/inventory_tools/inventory_tools/overrides/purchase_invoice.py index 5636713..8e9bad5 100644 --- a/inventory_tools/inventory_tools/overrides/purchase_invoice.py +++ b/inventory_tools/inventory_tools/overrides/purchase_invoice.py @@ -2,7 +2,6 @@ # See license.txt import datetime -import json import frappe from erpnext.accounts.doctype.purchase_invoice.purchase_invoice import PurchaseInvoice diff --git a/inventory_tools/inventory_tools/overrides/purchase_receipt.py b/inventory_tools/inventory_tools/overrides/purchase_receipt.py index e4e09b3..1100bab 100644 --- a/inventory_tools/inventory_tools/overrides/purchase_receipt.py +++ b/inventory_tools/inventory_tools/overrides/purchase_receipt.py @@ -1,7 +1,6 @@ # Copyright (c) 2023, AgriTheory and Contributors # See license.txt -import json import frappe from erpnext.stock.doctype.purchase_receipt.purchase_receipt import PurchaseReceipt diff --git a/inventory_tools/inventory_tools/overrides/uom.py b/inventory_tools/inventory_tools/overrides/uom.py index 21fa22d..0d580b4 100644 --- a/inventory_tools/inventory_tools/overrides/uom.py +++ b/inventory_tools/inventory_tools/overrides/uom.py @@ -3,7 +3,6 @@ import frappe from frappe.desk.reportview import execute -from frappe.desk.search import search_link @frappe.whitelist() diff --git a/inventory_tools/inventory_tools/overrides/workstation.py b/inventory_tools/inventory_tools/overrides/workstation.py index 7907ab8..c6cecc2 100644 --- a/inventory_tools/inventory_tools/overrides/workstation.py +++ b/inventory_tools/inventory_tools/overrides/workstation.py @@ -2,12 +2,10 @@ # For license information, please see license.txt import datetime -import json import frappe from erpnext.manufacturing.doctype.workstation.workstation import Workstation from frappe.desk.reportview import execute -from frappe.desk.search import search_link from frappe.utils.data import comma_and, flt, get_time, time_diff_in_hours diff --git a/inventory_tools/inventory_tools/report/material_demand/material_demand.py b/inventory_tools/inventory_tools/report/material_demand/material_demand.py index f1d313a..f619af0 100644 --- a/inventory_tools/inventory_tools/report/material_demand/material_demand.py +++ b/inventory_tools/inventory_tools/report/material_demand/material_demand.py @@ -7,7 +7,6 @@ import frappe from erpnext.stock.doctype.item.item import get_last_purchase_details from erpnext.stock.get_item_details import get_price_list_rate_for -from frappe import _ from frappe.query_builder import DocType from frappe.query_builder.functions import Coalesce from frappe.utils.data import fmt_money, getdate diff --git a/inventory_tools/tests/test_manufacturing_capacity.py b/inventory_tools/tests/test_manufacturing_capacity.py index d3955b8..466ffb5 100644 --- a/inventory_tools/tests/test_manufacturing_capacity.py +++ b/inventory_tools/tests/test_manufacturing_capacity.py @@ -3,12 +3,6 @@ import frappe import pytest -from erpnext.manufacturing.doctype.work_order.work_order import ( - create_job_card, - make_stock_entry, - make_work_order, -) -from frappe.exceptions import ValidationError from frappe.utils import getdate from inventory_tools.inventory_tools.report.manufacturing_capacity.manufacturing_capacity import ( diff --git a/inventory_tools/tests/test_overproduction.py b/inventory_tools/tests/test_overproduction.py index 6a15763..5fa4923 100644 --- a/inventory_tools/tests/test_overproduction.py +++ b/inventory_tools/tests/test_overproduction.py @@ -7,7 +7,7 @@ import pytest from erpnext.manufacturing.doctype.work_order.work_order import create_job_card, make_stock_entry from frappe.exceptions import ValidationError -from frappe.utils import now, strip_html, get_datetime +from frappe.utils import strip_html, get_datetime from inventory_tools.inventory_tools.overrides.work_order import get_allowance_percentage