From 63c061e5e823cb05c3fb2264c032bec7e90955a4 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 11 Aug 2023 12:55:25 +0000 Subject: [PATCH] fix: wrap none type rate under flt (backport #36602) (#36604) fix: wrap none type rate under flt (#36602) (cherry picked from commit 627986efa1a29ccf419f0e845cdca4f49589bac3) Co-authored-by: Anand Baburajan --- erpnext/controllers/status_updater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index a4bc4a9c69e4..f3663cc52711 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -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"]):