fix: consumed operation cost calculation (#54858)

This commit is contained in:
Mihir Kandoi
2026-05-21 14:55:46 +05:30
committed by GitHub
parent 06477119d1
commit 2f35660142
11 changed files with 362 additions and 72 deletions

View File

@@ -281,10 +281,10 @@ class StatusUpdater(Document):
# get unique transactions to update
for d in self.get_all_children():
if hasattr(d, "qty") and d.qty < 0 and not self.get("is_return"):
if hasattr(d, "qty") and flt(d.qty) < 0 and not self.get("is_return"):
frappe.throw(_("For an item {0}, quantity must be positive number").format(d.item_code))
if hasattr(d, "qty") and d.qty > 0 and self.get("is_return"):
if hasattr(d, "qty") and flt(d.qty) > 0 and self.get("is_return"):
frappe.throw(_("For an item {0}, quantity must be negative number").format(d.item_code))
if (