sale_order_line_section
sale_order_line_section · OCA/sale-workflow
-
Security25/25No findings
-
Activity25/25Human commit this month
-
Required by5/250 modules depend on it
-
Maturity5/25In 1 Odoo series since 19.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `WITH ordered_lines AS ( SELECT sol.id, sol.display_type, MAX(CASE WHEN sol.display_type = 'line_section' THEN sol.id END) OVER ( PARTITION BY sol.order_id ORDER BY sol.sequence, sol.id ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) AS previous_section_id FROM sale_order_line sol ) UPDATE sale_order_line sol SET section_id = CASE WHEN ol.display_type = 'line_section' THEN NULL ELSE ol.previous_section_id END FROM ordered_lines ol WHERE sol.id = ol.id` - re-check the table/column names still match after upgrading. migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
This module adds a stored Section field on sale order lines.
In standard Odoo, the relation between a line and its section is only implicit: a line belongs to the nearest previous section according to the order sequence. This is inconvenient for domains, grouping, reporting, or custom business logic because there is no direct field to use.
With this module, each non-section sale order line is linked to its nearest previous section line.
Typical use cases include:
- grouping sale order lines by section in tree views, exports, or reports;
- filtering all lines that belong to a given section without recomputing the relation from the sequence;
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 1
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
view_order_form |
sale.order | form | Inherits sale.view_order_form |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 1
-
section_idMany2one → sale.order.linecomodel_name='sale.order.line'compute='_compute_section_id'compute_sudo=Trueindex=Truestore=True
No public methods.
Loading…