diff --git a/addons/auth_oauth/__manifest__.py b/addons/auth_oauth/__manifest__.py index c78134cb07825c24a0e00fd08e2cd43d9ceaffe5..4f63d5172625286ea15bf49f32829ce500622fa3 100644 --- a/addons/auth_oauth/__manifest__.py +++ b/addons/auth_oauth/__manifest__.py @@ -12,7 +12,6 @@ Allow users to login through OAuth2 Provider. 'depends': ['base', 'web', 'base_setup', 'auth_signup'], 'data': [ 'data/auth_oauth_data.xml', - 'data/auth_oauth_data.yml', 'views/auth_oauth_views.xml', 'views/res_users_views.xml', 'views/res_config_settings_views.xml', diff --git a/addons/auth_oauth/data/auth_oauth_data.xml b/addons/auth_oauth/data/auth_oauth_data.xml index 1b1ff532ae40fd084b412875be18e500fc77db54..e2d061611f5052fb9bb9e1f0257bd814dfefa848 100644 --- a/addons/auth_oauth/data/auth_oauth_data.xml +++ b/addons/auth_oauth/data/auth_oauth_data.xml @@ -29,5 +29,13 @@ <field name="css_class">fa fa-google-plus-square</field> <field name="body">Log in with Google</field> </record> + + <!-- Use database uuid as client_id for OpenERP oauth provider --> + <function model="auth.oauth.provider" name="write"> + <value eval="[ref('auth_oauth.provider_openerp')]"/> + <value model="ir.config_parameter" eval="{ + 'client_id': obj().env['ir.config_parameter'].get_param('database.uuid'), + }"/> + </function> </data> </odoo> diff --git a/addons/auth_oauth/data/auth_oauth_data.yml b/addons/auth_oauth/data/auth_oauth_data.yml deleted file mode 100644 index 5ec3a53009bc71d7cea413322c6634728235b7eb..0000000000000000000000000000000000000000 --- a/addons/auth_oauth/data/auth_oauth_data.yml +++ /dev/null @@ -1,6 +0,0 @@ -- - Use database uuid as client_id for OpenERP oauth provider -- - !python {model: ir.config_parameter, id: False}: | - oauth = self.env['auth.oauth.provider'] - oauth.browse(ref('provider_openerp')).write({'client_id': self.get_param('database.uuid')})