fix: Consider parenttype while updating total qty in transactions

This commit is contained in:
Nabin Hait 2019-02-14 19:34:43 +05:30
parent 1a7e438fb2
commit 6f7a4d94ce

View File

@ -19,9 +19,10 @@ def execute():
SELECT SELECT
parent, SUM(qty) as qty parent, SUM(qty) as qty
FROM FROM
`tab%s Item` `tab{0} Item`
where parenttype = %s
GROUP BY parent 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 # 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 # batch_size is chosen arbitrarily, Don't try too hard to reason about it