Skip to content

Conversation

@rrahir
Copy link
Collaborator

@rrahir rrahir commented Oct 27, 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).

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

@robodoo
Copy link
Collaborator

robodoo commented Oct 27, 2025

This PR targets the disabled branch odoo/o-spreadsheet:saas-18.1, it needs to be retargeted before it can be merged.

@robodoo
Copy link
Collaborator

robodoo commented Oct 27, 2025

Pull request status dashboard

@rrahir rrahir force-pushed the saas-18.1-fix-missing-chart-deps-rar branch from c142f5e to 50e6570 Compare October 27, 2025 14:55
@robodoo
Copy link
Collaborator

robodoo commented Oct 27, 2025

This PR targets the disabled branch odoo/o-spreadsheet:saas-18.1, it needs to be retargeted before it can be merged.

@rrahir rrahir force-pushed the saas-18.1-fix-missing-chart-deps-rar branch from 50e6570 to cd4a145 Compare October 27, 2025 15:04
@robodoo
Copy link
Collaborator

robodoo commented Oct 27, 2025

This PR targets the disabled branch odoo/o-spreadsheet:saas-18.1, it needs to be retargeted before it can be merged.

@rrahir rrahir force-pushed the saas-18.1-fix-missing-chart-deps-rar branch from cd4a145 to 4ee15c7 Compare November 7, 2025 11:38
@robodoo
Copy link
Collaborator

robodoo commented Nov 7, 2025

This PR targets the disabled branch odoo/o-spreadsheet:saas-18.1, it needs to be retargeted before it can be merged.

@rrahir rrahir changed the base branch from saas-18.1 to saas-18.2 November 7, 2025 11:38
@rrahir
Copy link
Collaborator Author

rrahir commented Nov 7, 2025

@robodoo help

@robodoo
Copy link
Collaborator

robodoo commented Nov 7, 2025

Currently available commands for @rrahir:

command
help displays this help
r(eview)+ approves the PR, if it's a forwardport also approves all non-detached parents
r(eview)=<number> only approves the specified parents
fw=no does not forward-port this PR
fw=default forward-ports this PR normally
fw=skipci does not wait for a forward-port's statuses to succeed before creating the next one
fw=skipmerge does not wait for the source to be merged before creating forward ports
up to <branch> only ports this PR forward to the specified branch (included)
merge integrate the PR with a simple merge commit, using the PR description as message
rebase-merge rebases the PR on top of the target branch the integrates with a merge commit, using the PR description as message
rebase-ff rebases the PR on top of the target branch, then fast-forwards
squash squashes the PR as a single commit on the target branch, using the PR description as message
delegate+ grants approval rights to the PR author
delegate=<...> grants approval rights on this PR to the specified github users
nice only stages the PR if there's room in the batch after default PRs
default stages the PR normally
priority tries to stage this PR first, then adds default PRs if the staging has room
alone stages this PR only with other PRs of the same priority
cancel=staging automatically cancels the current staging when this PR becomes ready
override=<...> marks overridable statuses as successful
check fetches or refreshes PR metadata, resets mergebot state

Note: this help text is dynamic and will change with the state of the PR.

@rrahir
Copy link
Collaborator Author

rrahir commented Nov 7, 2025

robodoo fw=no

@robodoo
Copy link
Collaborator

robodoo commented Nov 7, 2025

Disabled forward-porting.

Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

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

👋

Comment on lines 70 to 72
if (!extensionsLoaded) {
unregisterChartJsExtensions();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems wrong no ? this will unload the chartJExtensions if they were loaded before calling this helper, and we only converted gauge/scorecards. The load/unload should probably be fully inside the if("chartJsConfig" in runtime)

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
@rrahir rrahir force-pushed the saas-18.1-fix-missing-chart-deps-rar branch from 4ee15c7 to 7379762 Compare November 12, 2025 20:00
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.

4 participants