[19.0] web_timeline: ValueError "Invalid field 'date_start:month'" when grouping by a date field

Open
#3,807 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@stferraro is already working on this.

Since Nov 13, 2026.

  • #3808 by @stferraro — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript
Domain
frontend

Research direction

Start with static/src/views/timeline/timeline_model.esm.js, especially load() and _event_data_transform(), and compare the group-by values sent to search_read with the grouping formats those methods handle. Reproduce the reported case by grouping a timeline by a date field with a granularity. Done means the view no longer crashes and either groups by the date period or falls back to its default group-by; linked pull request #3808 is already open.

Written by the indexing model from the issue text.

Description

bug
Module

web_timeline (19.0)

Describe the bug

When a timeline view is open and the user groups by a date/datetime field from the search panel (e.g. Start Date > Month), the view crashes with a server error.

To Reproduce

Affected versions: 19.0

Steps to reproduce the behavior:

  1. Install web_timeline and open a model that has a timeline view (e.g. project.project / project.task).
  2. Switch to the Timeline view.
  3. In the search panel, choose Group By > Start Date > Month (any date field and any granularity).
  4. See error.

Expected behavior
The view should not crash. Either the records are grouped by the date period, or unsupported group-bys are ignored and the default group-by is used.

Traceback
ValueError: Invalid field 'date_start:month' on 'project.project'
  File "odoo/orm/models.py", line 5795, in search_read
  File "odoo/orm/models.py", line 1429, in search_fetch
  File "odoo/orm/models.py", line 3859, in _determine_fields_to_fetch
Cause

In static/src/views/timeline/timeline_model.esm.js, load() copies searchParams.groupBy as is into the fields list sent to search_read:

this.last_group_bys = searchParams.groupBy;            // ["date_start:month"]
fields = [...new Set(fields.concat(this.last_group_bys))];

Odoo 19 sends date group-bys with a granularity suffix (field:month, field:week, ...), which is not a valid field name for search_read.

Also, _event_data_transform() builds groups with record[field][0], so only many2one/many2many group-bys are actually supported.

Related

#3518 ([18.0] Multi group by) includes a commit that adds support for grouping by date/datetime with granularity, but it is still open and targets 18.0.

Possible minimal fix

Strip the granularity and ignore non-relational group-bys, falling back to default_group_by:

const groupBy = (searchParams.groupBy || [])
    .map((g) => g.split(":")[0])
    .filter((g) => ["many2one", "many2many"].includes(this.fields[g]?.type));
this.last_group_bys = groupBy.length
    ? groupBy
    : this.params.default_group_by.split(",");

Happy to open a PR with this fix if maintainers agree, or to help forward-port the date grouping from #3518 once it is merged.

Captura de pantalla 2026-11-13 a la(s) 6 01 19 p  m
  • #2367 reported the same bug on 15.0 but was closed by the stale bot without a fix.
Dominant language
JavaScript
Stars
1.2k
Forks
2.2k
Avg merge
3d 15h
Merged PRs (30d)
30

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OCA/web

All issues in OCA/web

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.