fix: Consider parenttype while updating total qty in transactions
diff --git a/erpnext/patches/v11_0/update_total_qty_field.py b/erpnext/patches/v11_0/update_total_qty_field.py
index fcb76af..cc8524f 100644
--- a/erpnext/patches/v11_0/update_total_qty_field.py
+++ b/erpnext/patches/v11_0/update_total_qty_field.py
@@ -19,9 +19,10 @@
SELECT
parent, SUM(qty) as qty
FROM
- `tab%s Item`
+ `tab{0} Item`
+ where parenttype = %s
GROUP BY parent
- ''' % (doctype), as_dict = True)
+ '''.format(doctype), doctype, as_dict = True)
# Query to update total_qty might become too big, Update in batches
# batch_size is chosen arbitrarily, Don't try too hard to reason about it