diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index dcc77af..5c00993 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -38,6 +38,27 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + black: + needs: [ py_json_merge ] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + fetch-depth: 2 + + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.10' + + - name: Install Black (Frappe) + run: pip install git+https://github.com/frappe/black.git + + - name: Run Black (Frappe) + run: black --check . + prettier: needs: [ py_json_merge ] runs-on: ubuntu-latest diff --git a/inventory_tools/inventory_tools/overrides/stock_entry.py b/inventory_tools/inventory_tools/overrides/stock_entry.py index 5703914..89f894a 100644 --- a/inventory_tools/inventory_tools/overrides/stock_entry.py +++ b/inventory_tools/inventory_tools/overrides/stock_entry.py @@ -1,7 +1,8 @@ import frappe +from erpnext.stock.doctype.stock_entry.stock_entry import FinishedGoodError, StockEntry from frappe import _ from frappe.utils import flt -from erpnext.stock.doctype.stock_entry.stock_entry import FinishedGoodError, StockEntry + from inventory_tools.inventory_tools.overrides.work_order import get_allowance_percentage @@ -151,7 +152,7 @@ def get_pending_raw_materials(self, backflush_based_on=None): return item_dict - + @frappe.whitelist() def get_production_item_if_work_orders_for_required_item_exists(stock_entry_name: str) -> str: stock_entry = frappe.get_doc("Stock Entry", stock_entry_name) @@ -175,5 +176,3 @@ def get_production_item_if_work_orders_for_required_item_exists(stock_entry_name return production_item return "" - -