Skip to content
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

[14.0][FIX] project_milestone : Wrong assignment of tasks to milestones when duplicating a project #1283 #1284

Open
wants to merge 5 commits into
base: 14.0
Choose a base branch
from

Conversation

abenzbiria
Copy link

@abenzbiria abenzbiria commented May 17, 2024

Fix for issue #1283

@OCA-git-bot
Copy link
Contributor

Hi @patrickrwilson,
some modules you are maintaining are being modified, check this out!

@abenzbiria
Copy link
Author

abenzbiria commented May 20, 2024

@OCA/project-maintainers : Here is a fix for issue #1283
Thank you for your review.

@abenzbiria abenzbiria changed the title [14.0][FIX] project_milestone : Wrong assignment of tasks to milestes when duplicating a project #1283 [14.0][FIX] project_milestone : Wrong assignment of tasks to milestones when duplicating a project #1283 May 20, 2024
@abenzbiria
Copy link
Author

Hi @aleuffre , @leemannd

Could you review the code of this PR, please?

Have a nice day

Copy link
Contributor

@aleuffre aleuffre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review, LGTM.

I wonder if there's a more robust way of finding the milestone instead of using the name. Maybe instead of copy=True the milestones could be copied "manually" inside the copy function, in order to have a mapping between old and new milestones.

milestone = project.milestone_ids.filtered(
lambda milestone: "2" not in milestone.name
)
assert tasks[0].milestone_id == milestone and tasks[1].milestone_id == milestone
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chore (non-blocking): would prefer the usage of self.assertTrue or similar instead of the raw assert

@TumbaoJu
Copy link

@OCA/project-service-maintainers : Thank you for your review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants