Skip to content

Conversation

@fw-bot
Copy link
Collaborator

@fw-bot fw-bot commented Nov 28, 2025

When calling the method chartToImage, the chartJs extensions might not be loaded as we load them conditionally when mounting a chart. Hence, calling ChartToImage when there are no visible charts in the viewport or if we just instantiate a model without loading a component Spreadsheet, the extensions will be missing.

Right now, the plugins/extensions are not fundamental to convert a chart to an image but this becomes problematic with the arrival of future charts (for instance Funnel).

This commit adds a check to ensure that the extensisons are loaded and unloads them after use as they can cause crashes when using the global ChartJs variable elsewhere (see #6076).

Task: 5214007

Description:

description of this task, what is implemented and why it is implemented that way.

Task: TASK_ID

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

Forward-Port-Of: #7379

When calling the method chartToImage, the chartJs extensions might not
be loaded as we load them conditionally when mounting a chart. Hence,
calling `ChartToImage` when there are no visible charts in the viewport
or if we just instantiate a model without loading a component
`Spreadsheet`, the extensions will be missing.

Right now, the plugins/extensions are not fundamental to convert a chart
to an image but this becomes problematic with the arrival of future
charts (for instance Funnel).

This commit adds a check to ensure that the extensisons are loaded and
unloads them after use as they can cause crashes when using the global
`ChartJs` variable elsewhere (see #6076).

Task: 5214007
X-original-commit: d146422
@robodoo
Copy link
Collaborator

robodoo commented Nov 28, 2025

Pull request status dashboard

@fw-bot
Copy link
Collaborator Author

fw-bot commented Nov 28, 2025

This PR targets 19.0 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@fw-bot
Copy link
Collaborator Author

fw-bot commented Nov 28, 2025

@rrahir @LucasLefevre the next pull request (#7563) is in conflict. You can merge the chain up to here by saying

@robodoo r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@rrahir
Copy link
Collaborator

rrahir commented Nov 28, 2025

robodoo r+

@robodoo robodoo closed this in b58dae9 Nov 28, 2025
@fw-bot fw-bot deleted the 19.0-saas-18.3-fix-missing-chart-deps-rar-480968-fw branch December 5, 2025 14:55
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.

3 participants