odoo/o-spreadsheet#7561
Created by fw-bot
Statuses:
- label
- odoo:saas-18.4-saas-18.3-fix-missing-chart-deps-rar-473160-fw
- head
- d9c82f8f311e16943c2fe9e077349c732f7ef474
- merged
- 4 days ago by BI, Rémi Rahir (rar)
| odoo/o-spreadsheet | |
|---|---|
| saas-18.3 | #7379 |
| saas-18.4 | #7561 |
| 19.0 | #7562 |
| master | #7563 missing r+ |
[FIX] Charts: Ensure Chart js extension are loaded on chart creation
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).
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