You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1KB

  1. # Copyright (C) 2016-Today: Odoo Community Association (OCA)
  2. # @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo import fields, models
  5. class GithubTeamRepository(models.Model):
  6. _name = "github.team.repository"
  7. _description = "Github Team Repository"
  8. _order = "team_id, repository_id"
  9. _PERMISSION_SELECTION = [
  10. ("undefined", "Undefined"),
  11. ("read", "Read"),
  12. ("write", "Write"),
  13. ("admin", "Admin"),
  14. ]
  15. # Column Section
  16. team_id = fields.Many2one(
  17. comodel_name="github.team",
  18. string="Team",
  19. required=True,
  20. index=True,
  21. readonly=True,
  22. ondelete="cascade",
  23. )
  24. repository_id = fields.Many2one(
  25. comodel_name="github.repository",
  26. string="Repository",
  27. required=True,
  28. index=True,
  29. readonly=True,
  30. ondelete="cascade",
  31. )
  32. permission = fields.Selection(
  33. selection=_PERMISSION_SELECTION,
  34. string="Permission",
  35. required=True,
  36. readonly=True,
  37. )
上海开阖软件有限公司 沪ICP备12045867号-1