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 #2165

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: #2164
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:

CONFLICT (modify/delete): src/components/figures/chart.ts deleted in HEAD and modified in 0b4f2a8d ([FIX] figure,chart: Enforce unicity of figure ids).  Version 0b4f2a8d ([FIX] figure,chart: Enforce unicity of figure ids) of src/components/figures/chart.ts left in tree.
CONFLICT (modify/delete): src/components/side_panel/chart_panel.ts deleted in HEAD and modified in 0b4f2a8d ([FIX] figure,chart: Enforce unicity of figure ids).  Version 0b4f2a8d ([FIX] figure,chart: Enforce unicity of figure ids) of src/components/side_panel/chart_panel.ts left in tree.
Auto-merging src/migrations/data.ts
Auto-merging src/plugins/core/chart.ts
CONFLICT (content): Merge conflict in src/plugins/core/chart.ts
Auto-merging src/types/commands.ts
CONFLICT (content): Merge conflict in src/types/commands.ts
Auto-merging src/types/workbook_data.ts
Auto-merging tests/__snapshots__/xlsx_export.test.ts.snap
Auto-merging tests/components/charts.test.ts
CONFLICT (content): Merge conflict in tests/components/charts.test.ts
Auto-merging tests/data.test.ts
Auto-merging tests/plugins/chart/basic_chart.test.ts
CONFLICT (content): Merge conflict in tests/plugins/chart/basic_chart.test.ts
Auto-merging tests/plugins/figures.test.ts
Auto-merging tests/plugins/import_export.test.ts
CONFLICT (content): Merge conflict in tests/plugins/import_export.test.ts
Auto-merging tests/xlsx_export.test.ts

stderr:

20:12:11.143072 git.c:455               trace: built-in: git cherry-pick 0b4f2a8d68c89865309378e0bb4ed52bc5ebfd56
error: could not apply 0b4f2a8d... [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: a829d0c
@rrahir rrahir force-pushed the 16.0-15.0-fix-charts-rar-Hgzu-fw branch from cbd2215 to 19ee4b5 Compare March 4, 2023 08:45
@rrahir
Copy link
Collaborator

rrahir commented Mar 4, 2023

@robodoo r+

robodoo pushed a commit that referenced this pull request Mar 4, 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 #2165

X-original-commit: a829d0c
Signed-off-by: Pierre Rousseau (pro) <[email protected]>
Signed-off-by: Rémi Rahir (rar) <[email protected]>
@robodoo robodoo temporarily deployed to merge March 4, 2023 09:15 Inactive
@robodoo robodoo closed this Mar 4, 2023
@fw-bot fw-bot deleted the 16.0-15.0-fix-charts-rar-Hgzu-fw branch March 18, 2023 09:46
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