[19.0][FIX] project_sequence: make creation test independent of sale_project#1730
Merged
OCA-git-bot merged 1 commit intoMay 14, 2026
Conversation
test_sequence_after_creation used Form(project.project) on a fresh
record. Form initialization runs every model onchange to compute
defaults, including sale_project's _onchange_sale_line_id, which reads
reinvoiced_sale_order_id — a field restricted by
sales_team.group_sale_salesman. When sale_project is installed in the
same database, the project-only manager test user has no sale rights
and the onchange raises AccessError, even though the behaviour being
tested has nothing to do with sales.
Replace the Form-based pre-save check with a non-persisted new()
record, which exercises the same invariant ("no sequence_code before
creation") without triggering unrelated onchanges. The post-save
assertions still use create() and remain unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Hi @yajo, @anddago78, |
MiquelRForgeFlow
approved these changes
May 14, 2026
|
Merging to unlock other Migration PRs, apologies for the rush /ocabot merge nobump |
Contributor
|
Hey, thanks for contributing! Proceeding to merge this for you. |
Contributor
|
Congratulations, your PR was merged at 2f696f8. Thanks a lot for contributing to OCA. ❤️ |
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.
test_sequence_after_creation used Form(project.project) on a fresh record. Form initialization runs every model onchange to compute defaults, including sale_project's _onchange_sale_line_id, which reads reinvoiced_sale_order_id — a field restricted by sales_team.group_sale_salesman. When sale_project is installed in the same database, the project-only manager test user has no sale rights and the onchange raises AccessError, even though the behaviour being tested has nothing to do with sales. Check #1691 for an example.
Replace the Form-based pre-save check with a non-persisted new() record, which exercises the same invariant ("no sequence_code before creation") without triggering unrelated onchanges. The post-save assertions still use create() and remain unchanged.