Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: group item reorder by (warehouse, material_request_type) #35818

Merged
merged 6 commits into from
Jul 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions erpnext/stock/doctype/item/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,16 +395,16 @@ def validate_barcode(self):

def validate_warehouse_for_reorder(self):
"""Validate Reorder level table for duplicate and conditional mandatory"""
warehouse = []
warehouse_material_request_type: list[tuple[str, str]] = []
for d in self.get("reorder_levels"):
if not d.warehouse_group:
d.warehouse_group = d.warehouse
if d.get("warehouse") and d.get("warehouse") not in warehouse:
warehouse += [d.get("warehouse")]
if (d.get("warehouse"), d.get("material_request_type")) not in warehouse_material_request_type:
warehouse_material_request_type += [(d.get("warehouse"), d.get("material_request_type"))]
else:
frappe.throw(
dj12djdjs marked this conversation as resolved.
Show resolved Hide resolved
_("Row {0}: An Reorder entry already exists for this warehouse {1}").format(
d.idx, d.warehouse
_("Row #{0}: A reorder entry already exists for warehouse {1} with reorder type {2}.").format(
d.idx, d.warehouse, d.material_request_type
),
DuplicateReorderRows,
)
Expand Down
Loading