Skip to content

[IMP] web_timeline: export timeline as SVG#3446

Open
cyrilfassiau wants to merge 2 commits intoOCA:18.0from
cyrilfassiau:imp-web_timeline-export-svg
Open

[IMP] web_timeline: export timeline as SVG#3446
cyrilfassiau wants to merge 2 commits intoOCA:18.0from
cyrilfassiau:imp-web_timeline-export-svg

Conversation

@cyrilfassiau
Copy link

[IMP] web_timeline: export timeline as SVG

This PR adds an Export SVG feature to web_timeline, so users can save the currently displayed timeline as an SVG for documentation/reporting purposes (as requested in the related issue discussion).

What’s inside

  • Add an Export SVG button in the timeline renderer toolbar.
  • Small toolbar layout tweak: wrap the existing buttons in an extra <div> and use flex layout so the new export button is visually separated and easier to find.
  • Export implementation:
    • Capture the rendered timeline DOM (vis-timeline)
    • Embed it into an SVG using a foreignObject
    • Inline computed styles to keep the exported SVG visually consistent outside Odoo

Notes / limitations

  • The exported SVG relies on foreignObject (compatibility may vary depending on the SVG viewer/editor).
  • Tested on a local Odoo instance in modern browsers.

Feedback request

Does this approach match the expected feature described in the issue?
I’m happy to adjust the implementation if another export strategy is preferred.

@OCA-git-bot
Copy link
Contributor

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

@cyrilfassiau cyrilfassiau force-pushed the imp-web_timeline-export-svg branch from 4f6d9ff to 9019d1b Compare February 21, 2026 23:13
Copy link
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’m not sure if this is due to an incorrect HTML or SVG structure, but I tested it locally with the project_timeline module. When I export the SVG from All Tasks and open it, I get this error.

Image Image

Additionally, please squash the commits.

export class TimelineRenderer extends Component {
setup() {
super.setup?.();
this.timelineRef = useRef("timelineRoot");
Copy link
Contributor

Choose a reason for hiding this comment

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

The timelineRef variable is unused, so it is not necessary; please remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants