slide_category_one2many
The content tab of an eLearning course is one relation pretending to be two: sections and lessons. This widget is the renderer that keeps them apart.
| Technical name | slide_category_one2many |
|---|---|
| Field types | one2many, many2many |
| Views | form, with an embedded list and an optional kanban |
| Module | website_slides, the eLearning app |
| Used in core | 1 occurrence, the Content tab of the course form in website_slides |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | No. It is a view XML widget and depends on a discriminating boolean on the child model |
| Alternatives | one2many, question_page_one2many, section_one2many, handle |
What the course content list does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
is_category | field on the child model | Hardcoded discriminator. Rows where it is true render as sections. On Odoo 19 the embedded list must load it; on the development branch the widget injects it. |
name | field on the child model | Hardcoded title column. On a section row it is given a colspan covering every non-handle column. |
default_is_category | context key on the create control | Set on a <create> control's context. When true, and the screen is not small, the new row is added inline; otherwise the row opens in a dialog. |
editable | string (list attribute) | The widget defaults the embedded list to editable at the bottom. Only section rows are actually inline editable.(default: bottom) |
mode | string (field attribute) | Which subviews are available. Core uses list,kanban so course content can also be browsed as cards. |
The section field name is hardcoded. The renderer uses is_category as its discriminator and name as the title column, both written literally in the source. In Odoo 19 the embedded list must load is_category itself, which the core view does with a column-invisible field; the development branch injects it as a related field instead.
Working examples
Why a section row is only a handle and a title
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. The development branch injects the section flag as a related field, removing the subview requirement. |
| Odoo 19.0 | Verified | Verified against the shipped source. The embedded list must load the section flag itself. |
| Odoo 18.0 | Verified | Identical behavior. |
| Odoo 17.0 | Verified | Identical behavior. This is where the registration became a descriptor. |
| Odoo 16.0 | Verified | Same renderer and behavior, but the component class was registered directly rather than a descriptor. |
Upgrade note. No XML change is needed between Odoo 16 and Odoo 19; the renderer and the behavior are the same throughout, and only the registration style changed, from registering the component class in Odoo 16 to a descriptor from Odoo 17 onwards. Custom JavaScript that imported the class on Odoo 16 needs adjusting; views do not.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Section rows look like ordinary rows | The embedded list does not load the section flag, which the renderer reads literally. Add the field with column_invisible="True", as the core view does. |
| Add Section opens a dialog | The create control's context does not set the section default, or the screen is treated as small. Add context="{'default_is_category': True}" to that control. On a phone the dialog is intentional. |
| A lesson row will not edit inline | Intended. Only section rows are inline editable in this renderer. Click the row to open the lesson form. |
| Pressing Enter does not create another row | Intended. This renderer leaves edit mode on Enter, Tab and Shift+Tab. Use Add Section again for the next section. |
| Lesson columns show values on section rows | The renderer collapses the row, but a column left visible can still print. Add an invisible expression on lesson-only columns, as the core view does. |
| Reordering does not stick | The sequence field is missing or not rendered with the handle widget. Include the sequence field with widget="handle" in the embedded list. |
Course content list vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
slide_category_one2many | Course content where one ordered relation carries sections and lessons together | Section rows collapse to a drag handle plus a stretched title, and only sections edit inline |
| one2many | An ordinary list of child records | No section rendering and no split between inline and dialog creation |
| question_page_one2many | The same pattern in the Survey app | Keeps an extra column on section rows and forces a save of the parent on every child edit |
| section_one2many | Generic sectioned relations | A different renderer with its own field conventions |
| handle | Reordering rows | A single column widget rather than a list renderer |
Frequently asked questions
Why can I type a section title inline but not a lesson?+
Why do my section rows look ordinary?+
Does it support any options?+
Why does Enter not add another row?+
What changes in Odoo 20?+
Building courses your learners actually finish?
Course structure, progress tracking and the admin screens behind them decide whether eLearning gets used after week one. We build and extend Odoo eLearning, including custom content models and the views that keep them usable.
Book a free consultation