fix: seed standard Item Groups under the existing tree root (backport #57616) - #57630
Merged
mihir-kandoi merged 2 commits intoJul 30, 2026
Merged
Conversation
install_fixtures always inserted "All Item Groups" as a parentless group.
On a site where another app had already created the root, ItemGroup.validate
re-parented it, leaving a second group-root that held the standard groups
while the real root held everything else.
This is reproducible with the healthcare app on a non-English site: its
after_install seeds the root as _("All Item Groups"), so a pt-BR site gets
"Todos os Grupos de Itens" as the root before the setup wizard runs. The
split predates #57390 -- the old translated-name lookup resolved to the same
root and produced an identical tree.
Resolve the root once with get_root_of (falling back to the canonical English
name on fresh installs) and use it for the root record's exists-guard and the
standard groups' parent, matching Company.create_default_departments.
Patch merges an already-seeded "All Item Groups" into the root it sits under,
lifting its children and repointing every link.
Closes #57581
(cherry picked from commit e7088d8)
mihir-kandoi
enabled auto-merge
July 30, 2026 13:52
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.
Closes #57581
install_fixturesalways inserted"All Item Groups"as a parentless group. When the tree already had a root,ItemGroup.validatere-parented it, leaving a second group-root holding the standard groups while the real root held everything else.Reproducible with the healthcare app on a non-English site: its
after_installseeds the root as_("All Item Groups"), so a pt-BR site getsTodos os Grupos de Itensas the root before the setup wizard runs.This predates #57390 — I reproduced it with the old translated-name lookup restored and got an identical tree, since
_("All Item Groups")resolved to the same root. (The healthcare side is a separate bug: it should seed the untranslated name likeinstall_fixturesdoes.)Resolve the root once with
get_root_of, falling back to the canonical English name on fresh installs, and use it for the root record's exists-guard and the standard groups' parent — same asCompany.create_default_departments.The patch merges an already-seeded
"All Item Groups"into the root it sits under, lifting its children and repointing every link. It only fires when that node is a group whose parent is exactly the current root, and is a no-op on re-run.This is an automatic backport of pull request #57616 done by Mergify.