Skip to content

Commit

Permalink
fix: wrap none type rate under flt (backport #36602) (#36604)
Browse files Browse the repository at this point in the history
fix: wrap none type rate under flt (#36602)

(cherry picked from commit 627986e)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
  • Loading branch information
mergify[bot] and anandbaburajan committed Aug 11, 2023
1 parent 96663d7 commit 63c061e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext/controllers/status_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def validate_qty(self):
if hasattr(d, "qty") and d.qty > 0 and self.get("is_return"):
frappe.throw(_("For an item {0}, quantity must be negative number").format(d.item_code))

if hasattr(d, "item_code") and hasattr(d, "rate") and d.rate < 0:
if hasattr(d, "item_code") and hasattr(d, "rate") and flt(d.rate) < 0:
frappe.throw(_("For an item {0}, rate must be a positive number").format(d.item_code))

if d.doctype == args["source_dt"] and d.get(args["join_field"]):
Expand Down

0 comments on commit 63c061e

Please sign in to comment.