[copy/paste cross spreadsheet] cross version paste should be prevented#8330
Closed
hokolomopo wants to merge 1 commit into18.0from
Closed
[copy/paste cross spreadsheet] cross version paste should be prevented#8330hokolomopo wants to merge 1 commit into18.0from
hokolomopo wants to merge 1 commit into18.0from
Conversation
Collaborator
6333aa4 to
e6d15c3
Compare
anhe-odoo
reviewed
Apr 13, 2026
|
|
||
| // Only paste the spreadsheet data in the clipboard if the versions match | ||
| if (contentToPaste.data?.version !== CURRENT_VERSION) { | ||
| contentToPaste = { text: cmd.clipboardContent.text }; |
Contributor
There was a problem hiding this comment.
Maybe it's not possible, but I'll find it clearer if we had something like
if (contentToPaste.data?. ...) {
contentToPaste.data = undefined;
}It will be more consistent with the above comment. Here I had to read the code 3 times to understand the fact that this line was to remove data instead of updating text. But maybe it's me that hasn't slept enough ... :D
Contributor
Author
There was a problem hiding this comment.
I didn't want to change the command content in place, but I can make the code clearer :)
When pasting content from the clipboard, we try to paste the spreadsheet content without checking the version of the content, and only fallback if an error was thrown. This is not very resilient, as allowDispatch don't throw, and the model isn't transaction-based, so half of the paste can be applied before an error is thrown. We will now prevent pasting spreadsheet content if the versions do not match, and warn the user. Task: 6095101
e6d15c3 to
1f99295
Compare
Collaborator
|
robodoo r+ |
robodoo
pushed a commit
that referenced
this pull request
Apr 14, 2026
When pasting content from the clipboard, we try to paste the spreadsheet content without checking the version of the content, and only fallback if an error was thrown. This is not very resilient, as allowDispatch don't throw, and the model isn't transaction-based, so half of the paste can be applied before an error is thrown. We will now prevent pasting spreadsheet content if the versions do not match, and warn the user. closes #8330 Task: 6095101 Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
This was referenced Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description:
description of this task, what is implemented and why it is implemented that way.
Task: 6095101
review checklist