Revert "fix(stock): guard traceability qty division against a zero divisor (Postgres)"

This reverts commit 3859919263.
This commit is contained in:
Mihir Kandoi
2026-06-23 23:07:54 +05:30
parent 49e3830e7f
commit c989e424f0

View File

@@ -4,7 +4,6 @@
import frappe
from frappe import _
from frappe.query_builder import Case
from frappe.query_builder.functions import NullIf
def execute(filters: dict | None = None):
@@ -301,12 +300,9 @@ class ReportData:
(
(
stock_entry_detail.qty
/ NullIf(
Case()
.when(stock_entry.fg_completed_qty > 0, stock_entry.fg_completed_qty)
.else_(sabb_data.qty),
0,
)
/ Case()
.when(stock_entry.fg_completed_qty > 0, stock_entry.fg_completed_qty)
.else_(sabb_data.qty)
)
* sabb_data.qty
).as_("qty"),