[FIX] auth_oauth: fb and google oauth providers reset on general settings apply

- The res_config.xml file was missing in the manifest (so couldn't check the use of FB and Google OAuth from the general settings)
 - The default value for these oauth configuration were not set
This commit is contained in:
Denis Ledoux 2014-10-02 12:32:02 +02:00
parent 12df3fe5a0
commit f5cf5fd4eb
2 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,7 @@ Allow users to login through OAuth2 Provider.
'auth_oauth_data.xml',
'auth_oauth_data.yml',
'auth_oauth_view.xml',
'res_config.xml',
'security/ir.model.access.csv'
],
'js': ['static/src/js/auth_oauth.js'],

View File

@ -34,6 +34,11 @@ class base_config_settings(osv.TransientModel):
'auth_oauth_facebook_client_id' : fields.char('Client ID'),
}
def default_get(self, cr, uid, fields, context=None):
res = super(base_config_settings, self).default_get(cr, uid, fields, context=context)
res.update(self.get_oauth_providers(cr, uid, fields, context=context))
return res
def get_oauth_providers(self, cr, uid, fields, context=None):
google_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'auth_oauth', 'provider_google')[1]
facebook_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'auth_oauth', 'provider_facebook')[1]