Repository navigation
[18.0][FIX] hr_employee_id: use the employee's / current company, not the user's default one - #1644
Open
parabol123654 wants to merge 1 commit into
Open
parabol123654 wants to merge 1 commit into
parabol123654 wants to merge 1 commit into
Conversation
parabol123654
force-pushed
the
18.0-fix-hr_employee_id-company
branch
from
November 2, 2026 00:45
3a1d4c4 to
d06cfb2
Compare
…ser's default one The ID was generated with the settings of env.user.company_id, so an employee of another company got an ID from the wrong method, digits or sequence. The Settings defaults also came from env.user.company_id: opening Settings in another company showed the default company's values and saving them overwrote that company's configuration. Assisted-by: Claude Opus 5.5
parabol123654
force-pushed
the
18.0-fix-hr_employee_id-company
branch
from
November 14, 2026 18:27
d06cfb2 to
b185f18
Compare
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.
hr_employee_idreads its configuration fromself.env.user.company_id(the user's default company) instead of the employee's company / the selected company.Multi-company, user's default company A (random, 5 digits), company B configured with 8 digits (or a sequence), B selected in the company switcher:
Fix:
_generate_identification_idusesself.company_id or self.env.company(it is called on the new record;@api.modelremoved accordingly).self.env.company.Test
test_multi_company_generation: fails without the fix (5 != 8on the generated ID; with only the generation fixed,5 != 8on the Settings value, and on the company after saving the Settings), passes with it (10/10). The existingtest_multi_company_res_configswitchesuser.company_iditself, so it did not catch it.Assisted-by: Claude Opus 5.5