fix(Report): fix report group by field if not in format tabdoctype.fieldname
This commit is contained in:
parent
737ecae59d
commit
bf8630b6bd
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