Merge pull request #9834 from prssanna/report-group-by-fix
fix(Report): Fix report group by for existing reports
This commit is contained in:
commit
446c0636ac
1 changed files with 5 additions and 1 deletions
|
|
@ -93,6 +93,10 @@ frappe.ui.GroupBy = class {
|
|||
|
||||
apply_settings(settings) {
|
||||
|
||||
if (!settings.group_by.startsWith('`tab')) {
|
||||
settings.group_by = '`tab' + this.doctype + '`.`' + settings.group_by + '`';
|
||||
}
|
||||
|
||||
// Extract fieldname from `tabdoctype`.`fieldname`
|
||||
let group_by_fieldname = settings.group_by.split('.')[1].replace(/`/g, '');
|
||||
|
||||
|
|
@ -160,7 +164,7 @@ frappe.ui.GroupBy = class {
|
|||
if (this.aggregate_function === 'count') {
|
||||
aggregate_column = 'count(`tab'+ this.doctype + '`.`name`)';
|
||||
} else {
|
||||
aggregate_column =
|
||||
aggregate_column =
|
||||
`${this.aggregate_function}(\`tab${this.aggregate_on_doctype}\`.\`${this.aggregate_on}\`)`;
|
||||
aggregate_on_field = '`tab' + this.aggregate_on_doctype + '`.`' + this.aggregate_on + '`';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue