fix: error on gorup by

This commit is contained in:
Ejaaz Khan 2025-04-28 23:53:42 +05:30
parent 3f813b347e
commit 9734c8477e
2 changed files with 9 additions and 3 deletions

View file

@ -155,7 +155,7 @@ class File(Document):
self.validate_protected_file()
self._delete_file_on_disk()
if not self.is_folder:
self.add_comment_in_reference_doc("Attachment Removed", _("{0}").format(self.file_name))
self.add_comment_in_reference_doc("Attachment Removed", "{0}".format(self.file_name))
def on_rollback(self):
rollback_flags = ("new_file", "original_content", "original_path")
@ -767,7 +767,7 @@ class File(Document):
self.add_comment_in_reference_doc(
"Attachment",
_("{0}").format(f"<a href='{file_url}' target='_blank'>{file_name}</a>{icon}"),
"{0}".format(f"<a href='{file_url}' target='_blank'>{file_name}</a>{icon}"),
)
def add_comment_in_reference_doc(self, comment_type, text):

View file

@ -243,7 +243,13 @@ frappe.ui.GroupBy = class {
}
apply_group_by() {
if (this.group_by_doctype != this.aggregate_on_doctype) {
console.log(this.aggregate_on_doctype, this.group_by_doctype);
if (
this.group_by_doctype &&
this.aggregate_on_doctype &&
this.group_by_doctype != this.aggregate_on_doctype
) {
frappe.msgprint(__("Parent-to-child or child-to-parent grouping is not allowed."));
return false;
}