Skip to content

[20.0][FIX] base_user_role: preserve role sequence and write values - #1

Closed
pierre-pizzetta wants to merge 1 commit into
Studio73:20.0-mig-base_user_rolefrom
pierre-pizzetta:20.0-fix-base-user-role-write-values
Closed

pierre-pizzetta wants to merge 1 commit into
Studio73:20.0-mig-base_user_rolefrom
pierre-pizzetta:20.0-fix-base-user-role-write-values

Conversation

@pierre-pizzetta

Copy link
Copy Markdown

Changing a role's sequence currently writes the value to its associated group, leaving the role's own sequence unchanged. Writing an inherited field such as name also removes that key from the caller's values dictionary.

Copy the input values and forward only fields marked as inherited from the delegated group. This preserves the existing delegated-write workaround and keeps role-owned fields on the role.

This PR targets the source branch of OCA#488 so the fixes can be included in the existing Odoo 20 migration.

Validation against migration head dcf460154a016060d6c3a9e2d37b0af07def484d on Odoo 20 core a7950cab13fcb9400d58d582f5583c0f1c0f5405:

  • Both new regressions fail on the unmodified migration: sequence remains 10 instead of 42, and the caller dictionary becomes {}.
  • Patched upstream addon suite: 22 passed, 0 failures/errors/skips, including both mail cases.
  • Tests ran transactionally against an existing installed schema; fresh installation and normal upgrade of this OCA branch were not exercised.
  • Ruff 0.16.8 checks and formatting pass for both changed files; Python syntax and git diff --check pass. Full pre-commit was not run.

Assisted-by: OpenAI Codex

Route only inherited fields to the delegated group so updates to the
role-owned sequence field apply to the role. Copy write values before
separating delegated fields to preserve the caller dictionary.

Add regressions for independent role ordering and input preservation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant