Skip to content

Commit

Permalink
fix: group item reorder by (warehouse, material_request_type) (backport
Browse files Browse the repository at this point in the history
#35818) (#36425)

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

* fix: group item reorder by (warehouse, material_request_type)

* fix: update reorder error message

* chore: linter

* fix: correct error message

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>

* chore: linter

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
(cherry picked from commit e8eeeb1)

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
  • Loading branch information
mergify[bot] and dj12djdjs committed Jul 31, 2023
1 parent 33a9477 commit 516191b
Showing 1 changed file with 5 additions and 5 deletions.
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(
_("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

0 comments on commit 516191b

Please sign in to comment.