Files
odoo_source/addons/google_gmail/views/ir_mail_server_views.xml
T
qmo-odoo 04e86613c8 [ADD] {google,fetchmail}_gmail: OAuth for gmail servers
Purpose
=======
Less secured apps are no longer supported by google, therefore, we need
to transition to the OAuth2 authentication system.

Specifications
==============
1. User will need to fill their Gmail API credentials in the main
   settings page
2. Then, in the incoming / outgoing mail server form view, they will
   need to tick the Gmail support checkbox
3. A link will be available to be redirected to Gmail and accept the
   permission
4. The user can now copy / paste the authorization code in Odoo, set
   his email as "login" and then send / receive emails with Gmail

Task-2170676

closes odoo/odoo#83424

X-original-commit: ff223afc5300b2421b8ce935bb468f503c938c5d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-01-27 09:12:50 +00:00

32 lines
1.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="ir_mail_server_view_form" model="ir.ui.view">
<field name="name">ir.mail_server.view.form.inherit.gmail</field>
<field name="model">ir.mail_server</field>
<field name="inherit_id" ref="base.ir_mail_server_form"/>
<field name="arch" type="xml">
<field name="smtp_host" position="before">
<field name="use_google_gmail_service" string="Gmail"/>
</field>
<field name="smtp_user" position="after">
<field string="Authorization Code" name="google_gmail_authorization_code" password="True"
attrs="{'required': [('use_google_gmail_service', '=', True)], 'invisible': [('use_google_gmail_service', '=', False)]}"
style="word-break: break-word;"/>
<field name="google_gmail_uri"
class="fa fa-arrow-right oe_edit_only"
widget="url"
text=" Get an Authorization Code"
attrs="{'invisible': ['|', ('use_google_gmail_service', '=', False), ('google_gmail_uri', '=', False)]}"
nolabel="1"/>
<div class="alert alert-warning" role="alert"
attrs="{'invisible': ['|', ('use_google_gmail_service', '=', False), ('google_gmail_uri', '!=', False)]}">
Setup your Gmail API credentials in the general settings to link a Gmail account.
</div>
</field>
<field name="smtp_pass" position="attributes">
<attribute name="attrs">{'invisible' : [('use_google_gmail_service', '=', True)]}</attribute>
</field>
</field>
</record>
</odoo>