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

TA#72203 [MIG][16.0] project_task_subtask_same_project #458

Open
wants to merge 2 commits into
base: 16.0
Choose a base branch
from

Conversation

rivo2302
Copy link

No description provided.

@rivo2302 rivo2302 requested a review from majouda November 27, 2024 10:50
res = super().write(vals)
for task in self:
if task.child_ids and "project_id" in vals:
task.child_ids.write({"project_id": vals["project_id"]})
Copy link
Contributor

@majouda majouda Jan 7, 2025

Choose a reason for hiding this comment

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

Hello @rivo2302
I tested this code, but it's not working.
I'm unsure whether to keep it or not since it's not mentioned in the README.
I don't understand how the unit tests are passing without any issues.
Could you please verify this?

class ProjectTaskSubtaskSameProject(models.Model):
_inherit = "project.task"

def _check_subtask_not_in_different_project(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Hello @rivo2302
It would be preferable to use @api.constrains here instead of calling the check in the write() method.

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

Successfully merging this pull request may close these issues.

2 participants