Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Invoicing

Entity: account.report.line

Compute Method: _compute_foldability

View 20.0
Inputs Method Outputs
  • foldability
  • groupby
  • user_groupby
  • report_id
  • report_id.groupby
  • report_id.user_groupby
  • children_ids
  • expression_ids
+ for line in self:
+             if line.foldability:
+                 continue
+             has_groupby = bool(line.groupby or line.user_groupby or line.report_id.groupby or line.report_id.user_groupby)
+             if line.children_ids:
+                 line.foldability = 'always_unfolded'
+             elif has_groupby and all(expr.engine not in ('aggregation', 'external') for expr in line.expression_ids):
+                 line.foldability = 'foldable'
+             elif any(expr.engine in ('aggregation', 'external') for expr in line.expression_ids):
+                 line.foldability = 'never_unfolded'
+             else:
+                 line.foldability = 'always_unfolded'
  • foldability

Back to entity