Update frappe/desk/reportview.py

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
(cherry picked from commit 375cdea145)
This commit is contained in:
Rushabh Mehta 2021-03-31 10:10:46 +05:30 committed by mergify-bot
parent aa6288a265
commit 8203ab6ff7

View file

@ -116,7 +116,7 @@ def setup_group_by(data):
'''Add columns for aggregated values e.g. count(name)'''
if data.group_by:
if data.aggregate_function.lower() not in ('count', 'sum', 'avg'):
frappe.throw('Invalid aggregate function')
frappe.throw(_('Invalid aggregate function'))
if '`' in data.aggregate_on:
raise_invalid_field(data.aggregate_on)
data.fields.append('{aggregate_function}(`tab{doctype}`.`{aggregate_on}`) AS _aggregate_column'.format(**data))