Skip to content

Commit

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

fix: wrap none type rate under flt (backport #36602) (#36604)

fix: wrap none type rate under flt (#36602)

(cherry picked from commit 627986e)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit 63c061e)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mergify[bot] authored Aug 11, 2023
1 parent a4d6e00 commit e4e1f03
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 e4e1f03

Please sign in to comment.