Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FW][FIX] figure,chart: Enforce unicity of figure ids #2164

Closed
wants to merge 1 commit into from

Conversation

fw-bot
Copy link
Collaborator

@fw-bot fw-bot commented Mar 3, 2023

Description:

The issue of duplicated chart ids was first addressed in PR #2102 by
trying to defined chart ids per sheet (just like figures)
Unfortunately, the fix was not appropriate for several reasons:

  1. Some commands in Odoo were not dispatching the sheetId along with the
    chartId, making the mapping sheetId, chartId hazardous
  2. There was absolutely 0 verification that the commands targeting a
    chartId were also providing a sheet Id that matched. So the said
    commands cannot be trusted either

This commit is exploring the other solution that is forcing the unicity
of a figure id. The data are adapted so that figures with a duplicated
id well have the latter updated to ensure unicity.

This commit also tries to solve the wrong sheetId parameter in
UPDATE_CHART by simply ignoring it in the commands. It's not necesarry
since we now have the unicity of figure ids.
15.0-fix-charts-rar (#2157)
description of this task, what is implemented and why it is implemented that way.

Odoo task ID : 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 (_lt("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: #2157

@robodoo
Copy link
Collaborator

robodoo commented Mar 3, 2023

@fw-bot
Copy link
Collaborator Author

fw-bot commented Mar 3, 2023

@rrahir @pro-odoo cherrypicking of pull request #2157 failed.

stdout:

Auto-merging src/components/figures/chart.ts
Auto-merging src/components/side_panel/chart_panel.ts
CONFLICT (content): Merge conflict in src/components/side_panel/chart_panel.ts
Auto-merging src/migrations/data.ts
CONFLICT (content): Merge conflict in src/migrations/data.ts
Auto-merging src/plugins/core/chart.ts
Auto-merging src/plugins/core/figures.ts
CONFLICT (content): Merge conflict in src/plugins/core/figures.ts
Auto-merging src/types/commands.ts
Auto-merging src/types/getters.ts
CONFLICT (content): Merge conflict in src/types/getters.ts
Auto-merging src/types/workbook_data.ts
Auto-merging tests/__snapshots__/xlsx.test.ts.snap
Auto-merging tests/data.test.ts
Auto-merging tests/plugins/chart.test.ts
Auto-merging tests/plugins/figures.test.ts
Auto-merging tests/plugins/import_export.test.ts
Auto-merging tests/xlsx.test.ts

stderr:

16:46:58.172877 git.c:455               trace: built-in: git cherry-pick 0227135ca61c29938bcdd908a80e64a9b5905569
error: could not apply 0227135c... [FIX] figure,chart: Enforce unicity of figure ids
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
----------
status:

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

The issue of duplicated chart ids was first addressed in PR #2102 by
trying to defined chart ids per sheet (just like figures)
Unfortunately, the fix was not appropriate for several reasons:
1. Some commands in Odoo were not dispatching the sheetId along with the
   chartId, making the mapping sheetId, chartId hazardous
2. There was absolutely 0 verification that the commands targeting a
   chartId were also providing a sheet Id that matched. So the said
   commands cannot be trusted either

This commit is exploring the other solution that is forcing the unicity
of a figure id. The data are adapted so that figures with a duplicated
id well have the latter updated to ensure unicity.

This commit also tries to solve the wrong `sheetId` parameter in
`UPDATE_CHART` by simply ignoring it in the commands. It's not necesarry
since we now have the unicity of figure ids.

X-original-commit: f187fdd
@rrahir rrahir force-pushed the saas-15.2-15.0-fix-charts-rar-A_Pa-fw branch from 571b170 to 0b4f2a8 Compare March 3, 2023 18:52
@rrahir
Copy link
Collaborator

rrahir commented Mar 3, 2023

@robodoo r+

@rrahir
Copy link
Collaborator

rrahir commented Mar 3, 2023

@robodoo r-

@rrahir
Copy link
Collaborator

rrahir commented Mar 3, 2023

@robodoo r+

robodoo pushed a commit that referenced this pull request Mar 3, 2023
The issue of duplicated chart ids was first addressed in PR #2102 by
trying to defined chart ids per sheet (just like figures)
Unfortunately, the fix was not appropriate for several reasons:
1. Some commands in Odoo were not dispatching the sheetId along with the
   chartId, making the mapping sheetId, chartId hazardous
2. There was absolutely 0 verification that the commands targeting a
   chartId were also providing a sheet Id that matched. So the said
   commands cannot be trusted either

This commit is exploring the other solution that is forcing the unicity
of a figure id. The data are adapted so that figures with a duplicated
id well have the latter updated to ensure unicity.

This commit also tries to solve the wrong `sheetId` parameter in
`UPDATE_CHART` by simply ignoring it in the commands. It's not necesarry
since we now have the unicity of figure ids.

closes #2164

X-original-commit: f187fdd
Signed-off-by: Pierre Rousseau (pro) <[email protected]>
Signed-off-by: Rémi Rahir (rar) <[email protected]>
@robodoo robodoo temporarily deployed to merge March 3, 2023 19:11 Inactive
@robodoo robodoo closed this Mar 3, 2023
@fw-bot fw-bot deleted the saas-15.2-15.0-fix-charts-rar-A_Pa-fw branch March 17, 2023 19:47
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