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.

20 lines
616 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2016 SYLEAM
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. import uuid
  5. from openerp import models, fields
  6. class ResUsers(models.Model):
  7. _inherit = 'res.users'
  8. oauth_identifier = fields.Char(
  9. string='OAuth Identifier', required=True, readonly=True,
  10. default=lambda self: str(uuid.uuid4()), copy=False,
  11. help='String used to identify this user during an OAuth session.')
  12. _sql_constraints = [
  13. ('oauth_identifier_unique', 'UNIQUE (oauth_identifier)',
  14. 'The OAuth identifier of the user must be unique !'),
  15. ]