fix: Push aggregate_on_field to field list

- for proper extraction of child table
This commit is contained in:
Suraj Shetty 2021-10-12 09:54:09 +05:30
parent d7edd05a5d
commit 14ae20bdb8

View file

@ -127,6 +127,8 @@ def setup_group_by(data):
if frappe.db.has_column(data.aggregate_on_doctype, data.aggregate_on_field):
data.fields.append('{aggregate_function}(`tab{aggregate_on_doctype}`.`{aggregate_on_field}`) AS _aggregate_column'.format(**data))
if data.aggregate_on_field:
data.fields.append("`tab{aggregate_on_doctype}`.`{aggregate_on_field}`".format(**data))
else:
raise_invalid_field(data.aggregate_on_field)