so_template_line_o2m
Quotation templates gained optional sections in Odoo 19, and this widget is what keeps them honest: move a line into one and its quantity becomes zero, move it out and the quantity comes back.
| Technical name | so_template_line_o2m |
|---|---|
| Field types | one2many |
| Views | form, with an embedded list |
| Module | sale_management, the quotation templates app |
| Used in core | 1 occurrence, the Lines tab of the quotation template form in sale_management |
| Versions | Odoo 20.0, Odoo 19.0 |
| No-code setup | No. It is a view XML widget tied to the quotation template line model |
| Alternatives | so_line_field, section_and_note_text, product_label_section_and_note_field, one2many |
What the quotation template lines does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
subsections | boolean | Inherited from the section-and-note list. Enables a second level of section nesting. This is the option core turns on for quotation templates.(default: false) |
hide_prices | boolean | Inherited, and read in the base extractor without being declared. Hides price columns in the embedded list.(default: false) |
hide_composition | boolean | Inherited and undeclared in the same way. Hides the composition display of combo or kit lines.(default: false) |
aggregated_fields | string (attribute) | Inherited. A comma-separated list of fields to aggregate on section rows. Written as an attribute on the field element, not in options. |
The optional-section behavior is not configurable. The field name it toggles, the zero quantity it writes and the reset to one are all hardcoded, and the widget reads the quantity field by name. This is a widget built for one model, unlike the generic section list it extends.
Working examples
The quantity bookkeeping behind a drag
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. The development branch adds section quantity ratios and a unit of measure column; optional sections are unchanged. |
| Odoo 19.0 | Verified | First version. Verified against the shipped source. |
| Odoo 18.0 | Not available | Widget does not exist. Template lines used the generic section-and-note list. |
| Odoo 17.0 | Not available | Widget does not exist. |
| Odoo 16.0 | Not available | Widget does not exist. |
Upgrade note. The widget is new in Odoo 19, together with optional sections on quotation templates. On Odoo 18 and earlier the template lines used the generic section-and-note list, so an upgrade gains the feature without any view change. Custom quotation template views that replaced the lines field should switch the widget name to pick up the new behavior.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| A line I moved lost its quantity | It was dropped into an optional section, and the widget writes a quantity of zero for those lines. Set the quantity after the line is in its final position, or move it out of the optional section. |
| A line came back with quantity one, not its old value | Leaving an optional section resets a zero quantity to one; the previous value is not remembered. Re-enter the quantity after moving the line out. |
| Toggling a section optional did not update its lines | The rows under it are identified by position, so a structural row in between can end the section early. Check the section boundaries and the display type of the rows underneath. |
| Optional sections are not colored differently | The row class depends on the optional flag being loaded and true on the section. Make sure the flag field exists on the model and is part of the list. |
| The widget renders but nothing is optional | The child model does not carry the field names the widget writes literally. Use it only on the quotation template line model, or align your model's field names. |
| Subsections are not available | The inherited subsections option is off by default. Add options="{'subsections': True}" as the core view does. |
Quotation template lines vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
so_template_line_o2m | Quotation templates that separate core scope from optional add-ons | Adds optional sections to the section list and rewrites line quantities whenever the structure changes |
| so_line_field | Individual sale order line cells | A cell widget rather than a list renderer |
| section_and_note_text | The text cell inside a sectioned list | Renders section and note rows as free text, no quantity logic |
| product_label_section_and_note_field | The product cell in sectioned document lines | Handles the product label and description, not the section structure |
| one2many | An ordinary list of child records | No sections, no optional flag and no quantity bookkeeping |
Frequently asked questions
What makes a section optional in a quotation template?+
Why did my line's quantity change to zero?+
Does moving a line out restore its old quantity?+
Which options does it support?+
Can I use it on another model?+
Quotes that close faster, built once as a template
Optional sections, tiered scopes and templated pricing turn quoting from a writing task into a choice the customer makes. We configure Odoo Sales templates and the approval flow around them so your team quotes the same way every time.
Book a free consultation