Repository navigation
[18.0][FIX] hr_employee_firstname: create an employee from a user - #1664
Open
parabol123654 wants to merge 1 commit into
Open
parabol123654 wants to merge 1 commit into
parabol123654 wants to merge 1 commit into
Conversation
Contributor
|
Hi @luisg123v, @Savoir-faire Linux, |
hr.employee.create() takes the name of the linked user when no name is given, but this module raised "No name set." before reaching it, so an employee created with only a user_id could not be created. Take the name of the user in that case, before splitting it. Assisted-by: Claude Opus 5.5
parabol123654
force-pushed
the
18.0-fix-hr_employee_firstname-create-from-user
branch
from
November 14, 2026 18:35
70313b8 to
755b5eb
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.
When
hr.employee.create()gets auser_idand noname, core takes the name of the user (vals['name'] = vals.get('name', user.name)). This module checks the name before core runs and raises:So
hr.employee.create({"user_id": user.id})fails with this module installed. I found it by running the corehrtests with this module installed:TestChannelcreates its employee this way and fails insetUpClass.The fix: when none of
firstname,lastnameornameis given butuser_idis, the module takes the name of the user first, then splits it as usual. An employee created with no name and no user still raisesNo name set., astest_no_namechecks.Test:
test_create_from_usercreates an employee from a user named "Jean-Pierre Carnaud".No name set.hrtests pass (73 tests).Assisted-by: Claude Opus 5.5