Initial commit: Odoo 18.0-20251222 extra-addons
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled

This commit is contained in:
tocmo0nlord
2026-03-13 20:43:25 +00:00
parent 36e847a7df
commit adbe430761
9472 changed files with 1265727 additions and 0 deletions

View File

@@ -0,0 +1 @@
from . import excel_export

View File

@@ -0,0 +1,38 @@
# Copyright 2024 ForgeFlow S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import json
from collections import OrderedDict
from odoo import http
from odoo.addons.web.controllers.export import ExcelExport
class CustomGroupsTreeNode(ExcelExport):
@http.route("/web/export/xlsx", type="http", auth="user")
def web_export_xlsx(self, data):
params = json.loads(data)
self.context = params.get("context", {})
response = super().web_export_xlsx(data)
return response
@property
def context(self):
return self._context
@context.setter
def context(self, value):
self._context = value
def from_group_data(self, fields, columns_headers, groups):
collapse_groups = self.context.get("collapse_groups")
if collapse_groups:
for _child_key, child_node in groups.children.items():
aggregated_values = child_node.aggregated_values
if child_node.children:
child_node.children = OrderedDict()
if child_node.data:
child_node.data = []
child_node.aggregated_values = aggregated_values
return super().from_group_data(fields, columns_headers, groups)