-
-
Notifications
You must be signed in to change notification settings - Fork 673
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][MIG] hr_employee_lastnames: Migration to 17.0 #1315
[17.0][MIG] hr_employee_lastnames: Migration to 17.0 #1315
Conversation
4b4c2d0
to
29a2ce1
Compare
Hi @luisg123v could you review this please? cc. @luistorresm |
@andreagidaltig Then "hr_employee_lastnames" -> "hr_employee_second_lastname" |
else: | ||
lastname2 = self.lastname2 | ||
vals["name"] = self._get_name_lastnames(lastname, firstname, lastname2) | ||
elif vals.get("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.
Hi @andreagidaltig, i created a PR fixing some issues in the v14 module ( #1283) I could reproduce the bug on the runboat v17.
To reproduce you can create an employee with a first name equals to " Name 1 Name 2 name 3" and a lastname equals to "name4" if you export the data (including the external_id) and importing again the data, the name will be changed.
Could you fix it or cherry pick my commit? Thanks
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.
@FrancoMaxime since your PR is not merged yet, it shouldn't be included in the migration (because it's still subject to changes).
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.
@luisg123v Thanks, I hadn’t thought of that!
29a2ce1
to
63591ac
Compare
Not sure if that's a good idea. That will "break" systems being migrated from previous versions, because the old module would result uninstallable and the new one not installed. |
@@ -0,0 +1,2 @@ | |||
from . import models | |||
from .hooks import post_init_hook |
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.
Could you rename hooks file in the previous version, please?
3f311c4
to
2cf094e
Compare
@luisg123v If you want we can propose the PR in OpenUpgrade. apriory.py in OpenUpgrade Renamed modules is a mapping from old module name to new module name This PR is a example: https://github.com/OCA/OpenUpgrade/pull/4246/files |
Got it. I think module renaming should be on a separate commit, though, before running @moylop260 what do you think about renaming the module? |
I'm not a fan to rename modules But I don't have the enough context to do it Consider that you will need to change all the xmlids and you will need to change all the depends from the manifest of modules using this module |
@moylop260
@moylop260 |
Not for this:
😄 |
You are right, but now is the time to do it and make the nomenclature of the modules consistent. in the first line of the commit you indicate that you synchronize with the module partner_second_lastname Therefore partner_contact is like this: and in hr This is my last comment for it, thanks for all the work done. |
917966f
to
2e1db70
Compare
2e1db70
to
3c58fef
Compare
OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex
Currently translated at 100.0% (4 of 4 strings) Translation: hr-11.0/hr-11.0-hr_holidays_settings Translate-URL: https://translation.odoo-community.org/projects/hr-11-0/hr-11-0-hr_holidays_settings/fa/
Currently translated at 100,0% (4 of 4 strings) Translation: hr-11.0/hr-11.0-hr_holidays_settings Translate-URL: https://translation.odoo-community.org/projects/hr-11-0/hr-11-0-hr_holidays_settings/pt_BR/
Currently translated at 100.0% (8 of 8 strings) Translation: hr-16.0/hr-16.0-hr_employee_lastnames Translate-URL: https://translation.odoo-community.org/projects/hr-16-0/hr-16-0-hr_employee_lastnames/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: hr-16.0/hr-16.0-hr_employee_lastnames Translate-URL: https://translation.odoo-community.org/projects/hr-16-0/hr-16-0-hr_employee_lastnames/
Rename file of hooks to follow guidelines.
3c58fef
to
f466431
Compare
Hi @luisg123v could you review this, please? I just added the commit to rename the module. |
/ocabot migration hr_employee_lastnames |
Sorry @luisg123v you are not allowed to mark the addon tobe migrated. To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons. If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the |
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.
Commit message:
- AFAIK tag for module renaming is
[MOV]
- Commit message doesn't mention where the module is being renamed from. It should include both from and to, e.g.:
Module is renamed from hr_employee_lastnames → hr_employee_second_lastname inorder to be consistent with...
@@ -1,7 +1,7 @@ | |||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
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.
Commit message:
- sicronize -> synchronize. Besides, this would only go in PR description because it's not done on this commit anymore
- "Rename hooks file to follow guidelines.": not done on this commit anymore. This was done on v16, so not part of the migration anymore (hence should be removed also from PR's description).
|
||
|
||
class TestEmployeeLastnames(TransactionCase): | ||
def setUp(self): | ||
super(TestEmployeeLastnames, self).setUp() | ||
super().setUp() |
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.
Document in commit description
hr_employee_second_lastname/hooks.py
Outdated
# (firstname, lastname and lastname2). | ||
# | ||
# For example: | ||
# After install hr_employee_fisrtname and before install hr_employee_lastnames: |
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.
Missing renaming module here
# firstname = 'John' | ||
# lastname = 'Peterson' | ||
# lastname2 = 'Clinton' | ||
env.cr.execute("UPDATE hr_employee SET firstname = NULL, lastname = NULL") |
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.
Missing renaming module here
@@ -0,0 +1,3 @@ | |||
# Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved. | |||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | |||
from . import test_hr_employee_lastnames |
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.
And here.
Please fix all similar cases.
2c79f9d
to
aacd8a6
Compare
Hi @luisg123v changes applied, could you review again, please? |
from odoo.tools import submap | ||
|
||
|
||
class TestEmployeeLastnames(TransactionCase): |
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.
You forgot to update lastnames -> second lastname here.
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.
I just updated this, could you review again, please?
Module is renamed from hr_employee_lastnames → hr_employee_second_lastname in order to be consistent with partner_second_lastname module.
- Fix some new lints. - Update incoming parameters of post_init_hook method since `cr, registry` were replaced by `env` in [1]. - Deprecate the use of _onchange_spec method and use the method new method _get_fields_spec to return the fields specification from a view description since it was introduced in [2]. [1] odoo/odoo@b4a7996 [2] odoo/odoo@f5e6494
aacd8a6
to
4fb14e7
Compare
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 👍
@moylop260 could you review/merge, please?
/ocabot merge nobump |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 7bfa760. Thanks a lot for contributing to OCA. ❤️ |
in order to be consistent with partner_second_lastname module.
cr, registry
were replaced by
env
in [1].return the fields specification from a view description.
[1] odoo/odoo@b4a7996
[2] odoo/odoo@f5e6494