Skip to content

Commit

Permalink
Test alternative workstation (#80)
Browse files Browse the repository at this point in the history
* test: add test for alternative workstation

* feat: make alternative workstations configurable

* fix: uncomment js code for testing

* feat: search alternative workstation names

* refactor: pop filters that cause error for Workstation

* chore: update override commit hash

---------

Co-authored-by: Heather Kusmierz <[email protected]>
  • Loading branch information
agritheory and HKuz committed Jul 13, 2024
1 parent ce6b898 commit 6ec2a91
Show file tree
Hide file tree
Showing 18 changed files with 1,085 additions and 985 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ ignore =
W391,
W503,
W504,
W604,
E711,
E129,
F841,
Expand Down
2 changes: 1 addition & 1 deletion inventory_tools/inventory_tools/custom/operation.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"name": "Operation-alternative_workstations",
"no_copy": 0,
"non_negative": 0,
"options": "Alternative Workstations",
"options": "Alternative Workstation",
"owner": "Administrator",
"permlevel": 0,
"precision": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"modified": "2024-02-01 07:04:30.059469",
"modified_by": "Administrator",
"module": "Inventory Tools",
"name": "Alternative Workstations",
"name": "Alternative Workstation",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) 2024, AgriTheory and contributors
# For license information, please see license.txt

# import frappe
import frappe
from frappe.model.document import Document


class AlternativeWorkstations(Document):
class AlternativeWorkstation(Document):
pass
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"overproduction_percentage_for_work_order",
"section_break_0",
"update_warehouse_path",
"section_break_gzcbr",
"column_break_ddssn",
"allow_alternative_workstations",
"uoms_section",
"enforce_uoms"
],
Expand Down Expand Up @@ -79,19 +80,15 @@
},
{
"fieldname": "section_break_0",
"fieldtype": "Section Break"
"fieldtype": "Section Break",
"label": "Warehouses and Workstations"
},
{
"default": "0",
"fieldname": "update_warehouse_path",
"fieldtype": "Check",
"label": "Update Warehouse Path"
},
{
"fieldname": "section_break_gzcbr",
"fieldtype": "Section Break",
"label": "Warehouses"
},
{
"fieldname": "uoms_section",
"fieldtype": "Section Break",
Expand Down Expand Up @@ -146,11 +143,21 @@
"fieldtype": "Link",
"label": "Aggregated Sales Warehouse",
"options": "Warehouse"
},
{
"fieldname": "column_break_ddssn",
"fieldtype": "Column Break"
},
{
"default": "0",
"fieldname": "allow_alternative_workstations",
"fieldtype": "Check",
"label": "Allow Alternative Workstations"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-04-12 10:02:32.688310",
"modified": "2024-05-13 13:19:00.665445",
"modified_by": "Administrator",
"module": "Inventory Tools",
"name": "Inventory Tools Settings",
Expand Down
4 changes: 2 additions & 2 deletions inventory_tools/inventory_tools/overrides/operation.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import frappe


def validate_alternative_workstation(self, method):
def validate_alternative_workstation(self, method=None):
if self.workstation:
for row in self.alternative_workstations:
if row.workstation == self.workstation:
frappe.throw("Default Workstation should not be selected as alternative workstation")
frappe.throw(frappe._("Default Workstation should not be selected as alternative workstation"))
Loading

0 comments on commit 6ec2a91

Please sign in to comment.