19 lines
829 B
Python
19 lines
829 B
Python
from odoo import api, fields, models
|
|
|
|
class InternalTeams(models.Model):
|
|
_name = "internal.teams"
|
|
|
|
team_name = fields.Text("Team Name", required=True)
|
|
team_lead = fields.Many2one("res.users", string="Team Lead")
|
|
members_ids = fields.Many2many('res.users', 'internal_team_user_rel', 'team_id',
|
|
'user_id', 'Team Members', help="""Team Members are the users who are working in this particular team."""
|
|
)
|
|
active = fields.Boolean(default=True, help="Set active to false to hide the Teams without removing it.")
|
|
|
|
|
|
|
|
def _compute_display_name(self):
|
|
""" Custom display_name in case a registration is nott linked to an attendee
|
|
"""
|
|
for registration in self:
|
|
registration.display_name = registration.team_name |