-
-
Notifications
You must be signed in to change notification settings - Fork 868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[17.0][FIX] partner_firstname: fix error when creating a user from an employee #1725
[17.0][FIX] partner_firstname: fix error when creating a user from an employee #1725
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK on RunBoat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR has the |
@@ -65,6 +65,7 @@ def copy(self, default=None): | |||
@api.model | |||
def default_get(self, fields_list): | |||
"""Invert name when getting default values.""" | |||
fields_list.append("name") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, the proper fix is to do the stuff only if name
if fields_list
, not to force always to include that field in the results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pedrobaeza, I'm not sure to understand what do you propose, but I added a condition to add name
only if firstname
or lastname
is in fields_list
.
Let me know if there is a better solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, that can work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other issue #1757
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pr for FIX #1793
Steps to reproduce: - Install `hr` and `partner_firstname` - Go to Employees > any employee > action menu > Create User > Save - 💥 Traceback Suspected cause: in `defaul_get()`, the field `name` is not present in `fields_list` (probably because it's computed). So `result.get("name", "")` will always return `""` and `firstname` and `lastname` are not computed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ocabot merge patch
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at aa70256. Thanks a lot for contributing to OCA. ❤️ |
Steps to reproduce:
hr
andpartner_firstname
Suspected cause: in
defaul_get()
, the fieldname
is not present infields_list
(probably because it's computed). Soresult.get("name", "")
will always return""
andfirstname
andlastname
are not computed.