-
Notifications
You must be signed in to change notification settings - Fork 19
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
base: 16.0
Are you sure you want to change the base?
Conversation
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"]}) |
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.
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): |
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.
Hello @rivo2302
It would be preferable to use @api.constrains
here instead of calling the check in the write()
method.
No description provided.