Update update_total_qty_field.py

This commit is contained in:
Nabin Hait 2019-02-15 14:24:08 +05:30 committed by GitHub
parent 6f7a4d94ce
commit a0c9c7501b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,9 +20,9 @@ def execute():
parent, SUM(qty) as qty
FROM
`tab{0} Item`
where parenttype = %s
where parenttype = '{0}'
GROUP BY parent
'''.format(doctype), doctype, as_dict = True)
'''.format(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