diff options
| author | Kinjal Mehta <kme@odoo.com> | 2015-08-11 16:27:27 +0530 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2016-08-02 16:02:29 +0200 |
| commit | 914b2be9678e747b585839449de04f86464941d4 (patch) | |
| tree | 906f0dedeb1e7255527368c87513a2052061d6dc /addons/auth_oauth/views | |
| parent | 0a17a144c6f3a591f288104cdb81325e2984df7f (diff) | |
[MOVE]auth_oauth: Moved files in related models and views directory.
Diffstat (limited to 'addons/auth_oauth/views')
| -rw-r--r-- | addons/auth_oauth/views/auth_oauth_templates.xml (renamed from addons/auth_oauth/views/auth_oauth_login.xml) | 0 | ||||
| -rw-r--r-- | addons/auth_oauth/views/auth_oauth_views.xml | 47 | ||||
| -rw-r--r-- | addons/auth_oauth/views/res_config_views.xml | 111 | ||||
| -rw-r--r-- | addons/auth_oauth/views/res_users_views.xml | 23 |
4 files changed, 181 insertions, 0 deletions
diff --git a/addons/auth_oauth/views/auth_oauth_login.xml b/addons/auth_oauth/views/auth_oauth_templates.xml index a8fe99d30f8..a8fe99d30f8 100644 --- a/addons/auth_oauth/views/auth_oauth_login.xml +++ b/addons/auth_oauth/views/auth_oauth_templates.xml diff --git a/addons/auth_oauth/views/auth_oauth_views.xml b/addons/auth_oauth/views/auth_oauth_views.xml new file mode 100644 index 00000000000..58359ee9bfe --- /dev/null +++ b/addons/auth_oauth/views/auth_oauth_views.xml @@ -0,0 +1,47 @@ +<?xml version="1.0"?> +<openerp> + <data> + <record model="ir.ui.view" id="view_oauth_provider_form"> + <field name="name">auth.oauth.provider.form</field> + <field name="model">auth.oauth.provider</field> + <field name="arch" type="xml"> + <form string="arch"> + <sheet> + <group> + <field name="name" /> + <field name="client_id" /> + <field name="enabled" /> + <field name="body" /> + </group> + <group> + <field name="auth_endpoint" /> + <field name="scope" /> + <field name="validation_endpoint" /> + <field name="data_endpoint" /> + </group> + </sheet> + </form> + </field> + </record> + <record model="ir.ui.view" id="view_oauth_provider_list"> + <field name="name">auth.oauth.provider.list</field> + <field name="model">auth.oauth.provider</field> + <field name="arch" type="xml"> + <tree string="arch"> + <field name="name" /> + <field name="client_id" /> + <field name="enabled" /> + </tree> + </field> + </record> + <record model="ir.actions.act_window" id="action_oauth_provider"> + <field name="name">Providers</field> + <field name="res_model">auth.oauth.provider</field> + <field name="view_type">form</field> + <field name="view_mode">tree,form</field> + </record> + <menuitem id="menu_oauth_providers" name="OAuth Providers" + parent="base.menu_users" sequence="30" + action="action_oauth_provider" groups="base.group_no_one"/> + </data> +</openerp> diff --git a/addons/auth_oauth/views/res_config_views.xml b/addons/auth_oauth/views/res_config_views.xml new file mode 100644 index 00000000000..63f83d3ef4f --- /dev/null +++ b/addons/auth_oauth/views/res_config_views.xml @@ -0,0 +1,111 @@ +<?xml version="1.0"?> +<openerp> + <data> + <record model="ir.ui.view" id="view_general_configuration"> + <field name="name">base.config.settings.oauth</field> + <field name="model">base.config.settings</field> + <field name="inherit_id" ref="base_setup.view_general_configuration"/> + <field name="arch" type="xml"> + <xpath expr="//group[@name='google']/label" position="before"> + <label for="id" string="Authentication" attrs="{'invisible':[('module_auth_oauth','=',False)]}"/> + <div attrs="{'invisible':[('module_auth_oauth','=',False)]}"> + <div name="google" id="top"> + <div> + <field name="auth_oauth_google_enabled"/> + <label for="auth_oauth_google_enabled" string="Allow users to sign in with Google"/> + </div> + <div attrs="{'invisible':[('auth_oauth_google_enabled','=',False)]}"> + <div> + <label for="auth_oauth_tutorial_enabled" string="Show Tutorial"/> + <field name="auth_oauth_tutorial_enabled"/> + </div> + <div attrs="{'invisible':[('auth_oauth_tutorial_enabled','=',False)]}"> + <h2> + To setup the sign in process with Google, you have to perform + the following steps first. + </h2> + <ol> + <li> + Connect to your Google account and go to + <a href="https://console.developers.google.com/"> + https://console.developers.google.com/</a> + </li> + <li> + Click on <b>Create Project</b> and enter the project name and + other details. + <div class="mb8"> + <img src='/auth_oauth/static/src/img/steps_1.png'/> + </div> + <div class="mb8"> + <img src='/auth_oauth/static/src/img/steps_2.png'/> + </div> + </li> + <li> + Click on <b>Use Google APIs</b> + <div class="mb8"> + <img src='/auth_oauth/static/src/img/steps_3.png'/> + </div> + </li> + <li> + On the left side menu, select the sub menu <b>Credentials</b> + (from <b>API Manager</b>) then select <b>OAuth consent screen</b>. + <div class="mb8"> + <img src='/auth_oauth/static/src/img/steps_4.png'/> + </div> + </li> + <li> + Fill in your address, email and the product name (for example odoo) + and then save. + <div class="mb8"> + <img src='/auth_oauth/static/src/img/steps_5.png'/> + </div> + </li> + <li> + Then click on <b>Add Credentials</b> and select the second option + (OAuth 2.0 Client ID). + <div class="mb8"> + <img src='/auth_oauth/static/src/img/steps_6.png'/> + </div> + <div class="mb8"> + <img class="mt8" src='/auth_oauth/static/src/img/steps_7.png'/> + </div> + </li> + <li> + Check that the application type is set on <b>Web Application</b>. + Now configure the allowed pages on which you will be redirected. + </li> + <li> + To achieve this, complete the field <b>Authorized redirect URIs</b>. + Copy paste the following link in the box<b>: + <field name="server_uri_google"/></b> + <div class="clearfix"></div>Then click on <b>Create</b>. + <div class="mb8"> + <img class="mt8" src='/auth_oauth/static/src/img/steps_8.png'/> + </div> + </li> + <li> + Once done, you receive two information (your <b>Client ID</b> and <b> + Client Secret</b>). You have to insert your <b>Client ID</b> in + the field below. + <div class="mb8"> + <img src='/auth_oauth/static/src/img/steps_9.png'/> + </div> + </li> + <div> + <a onclick="document.getElementById('top').scrollIntoView();"> + Return to Top</a> + </div> + </ol> + </div> + <div class="o_row"> + <label for="auth_oauth_google_client_id" string="Google Client ID:"/> + <field name="auth_oauth_google_client_id" placeholder="e.g. 1234-xyz.apps.googleusercontent.com"/> + </div> + </div> + </div> + </div> + </xpath> + </field> + </record> + </data> +</openerp> diff --git a/addons/auth_oauth/views/res_users_views.xml b/addons/auth_oauth/views/res_users_views.xml new file mode 100644 index 00000000000..f9132d1eede --- /dev/null +++ b/addons/auth_oauth/views/res_users_views.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + <record id="view_users_form" model="ir.ui.view"> + <field name="name">res.users.form</field> + <field name="model">res.users</field> + <field name="type">form</field> + <field name="inherit_id" ref="base.view_users_form"/> + <field name="arch" type="xml"> + <xpath expr="//page[@name='access_rights']" position="after"> + <page string="Oauth"> + <group> + <field name="oauth_provider_id"/> + <field name="oauth_uid"/> + <field name="oauth_access_token"/> + </group> + </page> + </xpath> + </field> + </record> + </data> +</openerp> + |
