mirror of
https://github.com/bringout/oca-project.git
synced 2026-04-19 04:02:04 +02:00
Move 124 sale modules to oca-sale, create oca-project with 56 project modules from oca-workflow-process
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9eb7ae5807
commit
6094c218b2
2332 changed files with 125826 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class ProjectTask(models.Model):
|
||||
_inherit = "project.task"
|
||||
|
||||
sprint_id = fields.Many2one(
|
||||
comodel_name="project.sprint",
|
||||
string="Sprint",
|
||||
tracking=True,
|
||||
domain="['|', ('project_id', '=', False), ('project_id', '=', project_id)]",
|
||||
)
|
||||
|
||||
sprint_state = fields.Selection(
|
||||
related="sprint_id.state", string="Sprint State", store=True
|
||||
)
|
||||
|
||||
@api.constrains("user_ids")
|
||||
def _check_user_ids(self):
|
||||
for task in self:
|
||||
if task.user_ids and task.sprint_id:
|
||||
if not task.user_ids <= task.sprint_id.user_ids:
|
||||
raise ValidationError(
|
||||
_("The assignees must be part of the sprint.")
|
||||
)
|
||||
|
||||
@api.onchange("sprint_id")
|
||||
def _onchange_sprint_id(self):
|
||||
self.user_ids = False
|
||||
Loading…
Add table
Add a link
Reference in a new issue