[IMP] make a UuidGenerator singleton#8248
Closed
fdamhaut wants to merge 1 commit into
Closed
Conversation
Collaborator
hokolomopo
reviewed
Mar 31, 2026
Contributor
hokolomopo
left a comment
There was a problem hiding this comment.
Need a PR in odoo to change the new UuidGenerator() 🙂
| } | ||
| } | ||
|
|
||
| export const UuidGenerator = new UuidGeneratorClass(); |
Contributor
There was a problem hiding this comment.
nitpick: i'd make a real singleton or static methods in the class, but that's whatever🤷
778e0a3 to
2907ed5
Compare
LucasLefevre
reviewed
Apr 8, 2026
Collaborator
LucasLefevre
left a comment
There was a problem hiding this comment.
doesn't really matter to me, but curious about the choice static vs simple functions ?
Collaborator
|
(requires a rebase) |
Contributor
Author
🤷 I didn't see much difference between the two when ADRM asked and took the simplest change. |
691489b to
f009ab0
Compare
f009ab0 to
77b555f
Compare
The class `UuidGenerator` is useless. It has no state and the methods have no side-effects. They could be simple functions. Task: 6058383
77b555f to
dacd658
Compare
LucasLefevre
approved these changes
Apr 24, 2026
| }; | ||
| } | ||
| return new Model(dataToImport, undefined, undefined, undefined, false); | ||
| return new Model(dataToImport, undefined, undefined, undefined); |
Collaborator
There was a problem hiding this comment.
Suggested change
| return new Model(dataToImport, undefined, undefined, undefined); | |
| return new Model(dataToImport); |
robodoo
pushed a commit
that referenced
this pull request
Apr 24, 2026
The class `UuidGenerator` is useless. It has no state and the methods have no side-effects. They could be simple functions. closes #8248 Task: 6058383 Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
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.

Make a UuidGenerator singleton and use it instead of recreating a new instance every time it's needed.
Task: 6058383
Description:
description of this task, what is implemented and why it is implemented that way.
Task: 6058383
review checklist