diff options
| author | Kinjal Mehta <kme@odoo.com> | 2015-08-11 19:08:28 +0530 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2016-08-02 16:02:29 +0200 |
| commit | 3f201066f0f360eaf84ee02b661ad9994758f304 (patch) | |
| tree | 232c5547561b607876d0f6f005f10cbb7e57bcdb /addons/auth_oauth/models/auth_oauth.py | |
| parent | 914b2be9678e747b585839449de04f86464941d4 (diff) | |
[MIG]auth_oauth: Migrate to new api.
Diffstat (limited to 'addons/auth_oauth/models/auth_oauth.py')
| -rw-r--r-- | addons/auth_oauth/models/auth_oauth.py | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/addons/auth_oauth/models/auth_oauth.py b/addons/auth_oauth/models/auth_oauth.py index 52535fe8c14..de27556140c 100644 --- a/addons/auth_oauth/models/auth_oauth.py +++ b/addons/auth_oauth/models/auth_oauth.py @@ -1,25 +1,23 @@ -from openerp.osv import osv, fields +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. -class auth_oauth_provider(osv.osv): +from odoo import fields, models + + +class AuthOAuthProvider(models.Model): """Class defining the configuration values of an OAuth2 provider""" _name = 'auth.oauth.provider' _description = 'OAuth2 provider' _order = 'name' - _columns = { - 'name' : fields.char('Provider name', required=True), # Name of the OAuth2 entity, Google, etc - 'client_id' : fields.char('Client ID'), # Our identifier - 'auth_endpoint' : fields.char('Authentication URL', required=True), # OAuth provider URL to authenticate users - 'scope' : fields.char('Scope'), # OAUth user data desired to access - 'validation_endpoint' : fields.char('Validation URL', required=True),# OAuth provider URL to validate tokens - 'data_endpoint' : fields.char('Data URL'), - 'enabled' : fields.boolean('Allowed'), - 'css_class' : fields.char('CSS class'), - 'body' : fields.char('Body', required=True), - 'sequence' : fields.integer(), - } - _defaults = { - 'enabled' : False, - 'css_class' : "zocial", - } + name = fields.Char(string='Provider name', required=True) # Name of the OAuth2 entity, Google, etc + client_id = fields.Char(string='Client ID') # Our identifier + auth_endpoint = fields.Char(string='Authentication URL', required=True) # OAuth provider URL to authenticate users + scope = fields.Char() # OAUth user data desired to access + validation_endpoint = fields.Char(string='Validation URL', required=True) # OAuth provider URL to validate tokens + data_endpoint = fields.Char(string='Data URL') + enabled = fields.Boolean(string='Allowed') + css_class = fields.Char(string='CSS class', default='zocial') + body = fields.Char(required=True) + sequence = fields.Integer() |
