priority_switch
Project tasks use priority_switch, not the plain priority widget. The stars look identical; the difference lives entirely in the command palette.
| Technical name | priority_switch |
|---|---|
| Field types | selection |
| Views | form, list, kanban |
| Module | project |
| Used in core | 4 occurrences across 2 modules: project task forms and project_todo |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0 |
| No-code setup | No. Applied via the widget attribute in view XML |
| Alternatives | priority, state_selection, project_task_state_selection, selection_badge |
What the Priority switch does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
autosave | boolean | Inherited from the base priority widget. When true, changing the priority saves the entire record immediately, including other pending edits. Deleted on the Odoo 20 development branch.(default: true) |
Autosave saves the whole record. The default is true, so a star click or Alt+R on a form with unsaved required fields triggers a full save and can surface validation errors that seem unrelated to priority. Set options="{'autosave': False}" where that is unwanted.
Working examples
One getter, three consequences
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | Partial / changed | Not released. Widget file unchanged, but the inherited autosave option is deleted upstream; details below. |
| Odoo 19.0 | Verified | Verified against the shipped source. |
| Odoo 18.0 | Verified | Identical to 19.0 apart from a header comment. |
| Odoo 17.0 | Verified | Widget introduced in this version with the same behavior. |
| Odoo 16.0 | Not available | Widget does not exist; task views use the plain priority widget. |
Upgrade note. Present and unchanged from Odoo 17 through 19 apart from a header comment. Views moved from 16 need the widget name added, since 16 predates it and used the plain priority widget on tasks.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Alt+R does nothing in list or kanban view | Commands register only when viewType is form. Open the record's form view; keyboard priority switching is form-only by design. |
| Alt+R seems to pick a priority at random with a customized selection | All level commands share the hotkey and the first available one wins, which is only predictable with two levels. Use the command palette entries by name for selections with three or more levels. |
| Clicking a star raises required-field errors | Autosave defaults to true and saves the whole record. Add options="{'autosave': False}" or complete the required fields first. |
| Clicking the highest star cleared the priority instead | Inherited base behavior: clicking the star matching the current value resets to the first selection value. No fix needed; click a different star to set that level. |
| Widget not found error on a non-project database | priority_switch is registered by the project module, not web. Install project, or fall back to the plain priority widget. |
Priority switch vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
priority_switch | Task priority with fast keyboard triage | One named palette command per level, all on Alt+R |
| priority | Priority stars anywhere outside project | Single generic palette command instead of one per level |
| state_selection | Status dots with a dropdown | Colored bubble plus menu rather than a star row |
| project_task_state_selection | Task lifecycle states | Purpose-built state machine display for tasks |
| selection_badge | Visible one-click level pickers | Every level shown as a labeled badge, no icons |
Frequently asked questions
What is the difference between priority and priority_switch?+
Why does Alt+R toggle the star on and off?+
Can I use priority_switch on my own selection field?+
Does setting a priority save the record immediately?+
How do users clear a priority from the keyboard?+
Will priority_switch change in Odoo 20?+
Priority that actually drives the queue?
Stars are the easy part. Escalation rules, SLA timers, and priority-driven assignment are where task management earns its keep, and where Odoo needs deliberate configuration or a small custom module. We build exactly that layer on Odoo 16 through 19.
Book a free consultation