I am tryint to develope a module taht when you assign a task to a user automatically this user becomes a follower of the project. My code is:
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models, fields
class mod_project_project(models.Model):
_inherit = 'project.project'
@api.onchange('project.task.user_id')
def _onchange_partner(self):
if not project.task.user_id in message_follower_ids:
self.partner_id.message_subscribe(project.task.user_id)
But I don't get any result.
Thanks in advance