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.

32 lines
906B

  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 GithubOrganizationSerie(models.Model):
  6. _name = "github.organization.serie"
  7. _description = "Github Organization Serie"
  8. _order = "sequence, name"
  9. # Columns Section
  10. name = fields.Char(string="Name", required=True)
  11. sequence = fields.Integer(string="Sequence", required=True)
  12. organization_id = fields.Many2one(
  13. comodel_name="github.organization",
  14. string="Organization",
  15. ondelete="cascade",
  16. required=True,
  17. )
  18. _sql_constraints = [
  19. (
  20. "sequence_organization_uniq",
  21. "unique(organization_id, sequence)",
  22. "Sequence serie must be unique by organization.",
  23. )
  24. ]
上海开阖软件有限公司 沪ICP备12045867号-1