mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[IMP] bi_sql_editor : Allow to use sum / avg operator on tree view
This commit is contained in:
@@ -265,8 +265,14 @@ class BiSQLViewField(models.Model):
|
||||
elif self.tree_visibility == "optional_show":
|
||||
visibility_text = 'optional="show"'
|
||||
|
||||
operator_text = ""
|
||||
if self.group_operator == "sum":
|
||||
operator_text = f'sum="{_("Total")}"'
|
||||
elif self.group_operator == "avg":
|
||||
operator_text = f'avg="{_("Average")}"'
|
||||
|
||||
return (
|
||||
f"""<field name="{self.name}" {visibility_text}"""
|
||||
f"""<field name="{self.name}" {visibility_text} {operator_text}"""
|
||||
f""" context="{self.field_context}"/>\n"""
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user