Skip to content

[IMP] make a UuidGenerator singleton#8248

Closed
fdamhaut wants to merge 1 commit into
masterfrom
master-uuid-singleton-flda
Closed

[IMP] make a UuidGenerator singleton#8248
fdamhaut wants to merge 1 commit into
masterfrom
master-uuid-singleton-flda

Conversation

@fdamhaut
Copy link
Copy Markdown
Contributor

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

  • 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

@robodoo
Copy link
Copy Markdown
Collaborator

robodoo commented Mar 30, 2026

Pull request status dashboard

Copy link
Copy Markdown
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a PR in odoo to change the new UuidGenerator() 🙂

}
}

export const UuidGenerator = new UuidGeneratorClass();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: i'd make a real singleton or static methods in the class, but that's whatever🤷

@fdamhaut fdamhaut force-pushed the master-uuid-singleton-flda branch from 778e0a3 to 2907ed5 Compare April 7, 2026 08:08
Copy link
Copy Markdown
Collaborator

@LucasLefevre LucasLefevre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't really matter to me, but curious about the choice static vs simple functions ?

@LucasLefevre
Copy link
Copy Markdown
Collaborator

(requires a rebase)

@fdamhaut
Copy link
Copy Markdown
Contributor Author

fdamhaut commented Apr 9, 2026

doesn't really matter to me, but curious about the choice static vs simple functions ?

🤷 I didn't see much difference between the two when ADRM asked and took the simplest change.
I feel like classMethod are a bit clearer but It's mostly feeling based

@fdamhaut fdamhaut force-pushed the master-uuid-singleton-flda branch 3 times, most recently from 691489b to f009ab0 Compare April 9, 2026 08:58
@fdamhaut fdamhaut force-pushed the master-uuid-singleton-flda branch from f009ab0 to 77b555f Compare April 22, 2026 09:28
The class `UuidGenerator` is useless.
It has no state and the methods have no side-effects.
They could be simple functions.

Task: 6058383
@LucasLefevre LucasLefevre force-pushed the master-uuid-singleton-flda branch from 77b555f to dacd658 Compare April 24, 2026 13:39
Copy link
Copy Markdown
Collaborator

@LucasLefevre LucasLefevre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

robodoo r+

Comment thread tests/xlsx/xlsx_import_export.test.ts Outdated
};
}
return new Model(dataToImport, undefined, undefined, undefined, false);
return new Model(dataToImport, undefined, undefined, undefined);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@robodoo robodoo closed this Apr 24, 2026
@robodoo robodoo added the 19.4 label Apr 24, 2026
@fw-bot fw-bot deleted the master-uuid-singleton-flda branch May 1, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants