Skip to content

[16.0][IMP] web_timeline - support multiple group-by levels and allow to group by m2m field#3006

Merged
OCA-git-bot merged 3 commits intoOCA:16.0from
komit-consulting:web_timeline-multi-group-by
Oct 1, 2025
Merged

[16.0][IMP] web_timeline - support multiple group-by levels and allow to group by m2m field#3006
OCA-git-bot merged 3 commits intoOCA:16.0from
komit-consulting:web_timeline-multi-group-by

Conversation

@cuongnmtm
Copy link
Copy Markdown
Contributor

@cuongnmtm cuongnmtm commented Dec 2, 2024

Allowing to add multiple group-by levels

image

Test cases:

  • group by one field (group by m2o, selection, integer, m2m, date, ...)
  • group by multiple fields
  • group by 0 field: back to default group by
  • create a new record
  • drag and drop record to update
  • click on the group by to view the group by record detail
  • when group by m2m field, record is displayed multiple times if linked to multiple m2m records
  • when drag and drop, the value of the m2m field should not be updated as there is no best way to handle this
  • when creating a new record, set the default value for all grouped fields
  • handle group by non-relation fields: click on the group of selection or char field do not popup record form view to avoid error.
  • dependency_arrow between multiple collapse/expand groups

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @tarteo,
some modules you are maintaining are being modified, check this out!

@cuongnmtm cuongnmtm force-pushed the web_timeline-multi-group-by branch 2 times, most recently from 5a5f65b to 8cf395a Compare December 2, 2024 12:45
@pedrobaeza
Copy link
Copy Markdown
Member

Can you please put an screenshot of the feature?

@cuongnmtm
Copy link
Copy Markdown
Contributor Author

@pedrobaeza I have included a screenshot of the feature in the PR description.

@pedrobaeza pedrobaeza added this to the 16.0 milestone Dec 2, 2024
@pedrobaeza
Copy link
Copy Markdown
Member

Great improvement!

@cuongnmtm cuongnmtm changed the title [IMP] web_timeline - support multi group by level [IMP] web_timeline - support multiple group-by levels and allow to group by m2m field Dec 2, 2024
@cuongnmtm cuongnmtm force-pushed the web_timeline-multi-group-by branch 2 times, most recently from 7e7bc6e to e34aeec Compare December 2, 2024 20:40
Copy link
Copy Markdown
Member

@tarteo tarteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!
I get an error when I quickly add and remove a group (by double clicking). However if I click normally I don't get an error. There's probably a race condition somewhere

Error (I have assets debugging enabled):
UncaughtPromiseError > TypeError Uncaught Promise > Cannot read properties of undefined (reading 'relation') TypeError: Cannot read properties of undefined (reading 'relation') at Class.split_groups (http://localhost:8069/web/assets/debug/web.assets_backend.js:190546:71) (/web_timeline/static/src/js/timeline_renderer.js:509)

@cuongnmtm cuongnmtm force-pushed the web_timeline-multi-group-by branch 3 times, most recently from 8279013 to 0a27fb8 Compare December 6, 2024 12:40
@cuongnmtm
Copy link
Copy Markdown
Contributor Author

@tarteo I cannot reproduce your issue, but I found another related defect and fixed it (error when clicking on the group when group by non-relation field). Could you please help to check again? Thanks.

And other things had been done (inthe description).

@cuongnmtm
Copy link
Copy Markdown
Contributor Author

For non-technical who wish to test this feature, you can use the XML view arch below to create a timeline view for the project model and modify the project window action to include the timeline view mode for testing.

<timeline date_start="date_start" date_stop="date" string="Projects" default_group_by="user_id,partner_id,privacy_visibility" mode="week" event_open_popup="true" stack="true">
    <field name="user_id"/>
    <field name="privacy_visibility"/>
    <field name="tag_ids"/>
    <field name="name"/>
    <templates>
        <t t-name="timeline-item">
            <div t-att-title="record.name">
                <small>
                    <div>
                      <span>
                          <t t-esc="record.name"/>
                      </span>
                    </div>
                    <div>
                      PM:
                      <span>
                          <t t-esc="record.user_id[1]"/>
                      </span>
                    </div>
                  
                </small>
            </div>
        </t>
    </templates>
</timeline>

@pedrobaeza
Copy link
Copy Markdown
Member

We added on the scheduled actions the timeline view as demo data for demonstration purposes without requiring extra modules. Maybe you can modify that demo view to showcase this feature.

@cuongnmtm cuongnmtm force-pushed the web_timeline-multi-group-by branch from 0a27fb8 to f7b6591 Compare December 6, 2024 14:19
@cuongnmtm
Copy link
Copy Markdown
Contributor Author

We added on the scheduled actions the timeline view as demo data for demonstration purposes without requiring extra modules. Maybe you can modify that demo view to showcase this feature.

I missed that. Thanks.

@antoniodavid
Copy link
Copy Markdown

Awesome @cuongnmtm. It would be great to update the version of the addon.

@pedrobaeza
Copy link
Copy Markdown
Member

Awesome @cuongnmtm. It would be great to update the version of the addon.

No, that's done on merge by the bot, when we issue the command.

@cuongnmtm cuongnmtm force-pushed the web_timeline-multi-group-by branch from f7b6591 to 0bb5942 Compare December 13, 2024 08:53
Copy link
Copy Markdown

@minhthie minhthie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional test: LGTM

@hitrosol
Copy link
Copy Markdown

This is nice new feature.
One input from me:
Every time I click the arrow on the left or any field there, it will automatically show the popup form related to the field. If it's related to partner, then it will open the pop up of the partner, if it's related to the stage, then it will open the pop up form in of the Stage. Is it possible to disable the behaviour, because it's bit annoying to close the popup every time user click the arrow. Thanks.

@cuongnmtm
Copy link
Copy Markdown
Contributor Author

Hi @hitrosol ,

I will check if it is easy to do (if the arrow and the label are in the same element, it will be annoying to implement the change as we need to split them).

@cuongnmtm
Copy link
Copy Markdown
Contributor Author

BTW, I think a toggle for the stack option is nice to have as well. Right now, the timeline needs to be either stack or no-stack.

@cuongnmtm cuongnmtm force-pushed the web_timeline-multi-group-by branch from 0bb5942 to 3c80193 Compare May 9, 2025 20:40
@cuongnmtm
Copy link
Copy Markdown
Contributor Author

This is nice new feature. One input from me: Every time I click the arrow on the left or any field there, it will automatically show the popup form related to the field. If it's related to partner, then it will open the pop up of the partner, if it's related to the stage, then it will open the pop up form in of the Stage. Is it possible to disable the behaviour, because it's bit annoying to close the popup every time user click the arrow. Thanks.

@hitrosol I addressed this issue by changing the event trigger from a single "click" to a "double-click", thereby enhancing the user experience slightly.

Copy link
Copy Markdown
Contributor

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great feature, thanks.
I remember testing a similar feature in this PR: #2929, but this one looks better with support for multi-level grouping.
I'm leaving the results of my functional testing below. Please let me know if you need any additional information.

@hitrosol
Copy link
Copy Markdown

@cuongnmtm, would you please make the runboat available so I can try it again ?

@cuongnmtm cuongnmtm force-pushed the web_timeline-multi-group-by branch 2 times, most recently from 352d766 to a727e70 Compare August 29, 2025 07:24
@cuongnmtm
Copy link
Copy Markdown
Contributor Author

Hi @hitrosol , the new runboat is sailing. I also took the opportunity to improve the behavior when grouping by date and datetime fields, as noted by carlos-lopez-tecnativa above.

Copy link
Copy Markdown
Contributor

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it locally and it works, but I found this error when collapsing a group in project.task. In other views, however, the error is not present. I'm not sure if this view needs some adaptation or if the issue comes from these changes. Could you please review it?
image

@cuongnmtm cuongnmtm force-pushed the web_timeline-multi-group-by branch from a727e70 to 3c05eb7 Compare August 29, 2025 12:42
@cuongnmtm cuongnmtm force-pushed the web_timeline-multi-group-by branch from 3c05eb7 to 657adee Compare September 26, 2025 12:35
Copy link
Copy Markdown
Member

@tarteo tarteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Work perfectly now thanks

Copy link
Copy Markdown
Contributor

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@pedrobaeza
Copy link
Copy Markdown
Member

/ocabot merge major

Can you forward port it to upper versions?

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-3006-by-pedrobaeza-bump-major, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit e31304f into OCA:16.0 Oct 1, 2025
7 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 1e0ad4a. Thanks a lot for contributing to OCA. ❤️

@cuongnmtm
Copy link
Copy Markdown
Contributor Author

Thank you all. I will work on forward-porting this to the newer versions.

@pedrobaeza pedrobaeza changed the title [IMP] web_timeline - support multiple group-by levels and allow to group by m2m field [16.0][IMP] web_timeline - support multiple group-by levels and allow to group by m2m field Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants