-
-
Notifications
You must be signed in to change notification settings - Fork 870
[17.0][MIG] project_task_name_with_id: Migration to 17.0 #1472
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] project_task_name_with_id: Migration to 17.0 #1472
Conversation
Currently translated at 100.0% (1 of 1 strings) Translation: project-16.0/project-16.0-project_task_name_with_id Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_name_with_id/it/
mpascuall
left a comment
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!
peluko00
left a comment
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!
BernatObrador
left a comment
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.
10ed5ed to
ab2103e
Compare
ab2103e to
3387508
Compare
Done @BernatObrador !! |
BernatObrador
left a comment
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!
|
|
||
|
|
||
| class TestProjectTaskID(TransactionCase): | ||
| def setUp(self): |
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.
Just a minor comment, test should be using @classsmethod
| def setUp(self): | |
| @classmethod | |
| def setUpClass(cls): |
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.
Done!
| if hasattr(task, "key") and task.key: | ||
| parts.append(task.key) |
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.
Wasn't sure about the validity of this part. Shouldn't we add super()._compute_display_name() at the beginning to adjust the updated display_name, instead?
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.
@yostashiro this is to make the module compatible with project_key without depending on it. Or do you think it's not necessary?
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.
@lbarry-apsl IMO, we shouldn't add special logic just to be "compatible" with another module. Would there be any issue if we simply did the following?
@api.depends("name")
def _compute_display_name(self):
super()._compute_display_name()
for task in self:
task.display_name = f"[{task.id}] {task.display_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.
There wasn't an error, just that the task.key wasn't displayed in the ticket name added by the project_key module.
@yostashiro if it's not a problem, I can leave it as you've told me.
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.
@lbarry-apsl IMO, we shouldn't add special logic just to be "compatible" with another module. Would there be any issue if we simply did the following?
@api.depends("name") def _compute_display_name(self): super()._compute_display_name() for task in self: task.display_name = f"[{task.id}] {task.display_name}"
@yostashiro I have done the tests with what you propose here, but the result with the project_key is this and it is not correct [5] 5['OD-1', 'Energy Certificate']
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 have done the tests with what you propose here, but the result with the project_key is this and it is not correct
[5] 5['OD-1', 'Energy Certificate'].
@lbarry-apsl I think that's because how project_key doesn't use super() in _compute_display_name(). Likewise, the current implementation of this module may break the presentation of the display name if there is another module which manipulates with the field.
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.
Okay, I understand. I mentioned in this PR #1503 that it adds the super() function without modifying the logic.
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.
@lbarry-apsl @yostashiro I created PRs to avoid complete overidding.
#1502
#1503
| { | ||
| "name": "Project Task Name with ID", | ||
| "category": "Project", | ||
| "version": "17.0.1.0.1", |
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.
| "version": "17.0.1.0.1", | |
| "version": "17.0.1.0.0", |
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.
Done!
3387508 to
e885105
Compare
|
Hi @pedrobaeza , can you check this migration? |
|
/ocabot migration project_task_name_with_id |
|
What a great day to merge this nice PR. Let's do it! |
|
Congratulations, your PR was merged at 1c65bca. Thanks a lot for contributing to OCA. ❤️ |






Module migrated to version 17.0
cc https://github.com/APSL 7983
@miquelalzanillas @javierobcn @mpascuall @BernatObrador @ppyczko @peluko00 please review
#1191