mirror of
https://github.com/bringout/oca-ocb-security.git
synced 2026-04-25 02:02:06 +02:00
Initial commit: Security packages
This commit is contained in:
commit
bb469e4763
1399 changed files with 278378 additions and 0 deletions
|
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="fetchmail_server_view_form" model="ir.ui.view">
|
||||
<field name="name">fetchmail.server.view.form.inherit.outlook</field>
|
||||
<field name="model">fetchmail.server</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="inherit_id" ref="mail.view_email_server_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="user" position="after">
|
||||
<field name="is_microsoft_outlook_configured" invisible="1"/>
|
||||
<field name="microsoft_outlook_refresh_token" invisible="1"/>
|
||||
<field name="microsoft_outlook_access_token" invisible="1"/>
|
||||
<field name="microsoft_outlook_access_token_expiration" invisible="1"/>
|
||||
<div attrs="{'invisible': [('server_type', '!=', 'outlook')]}"
|
||||
class="d-flex flex-row align-items-center" colspan="2">
|
||||
<span attrs="{'invisible': ['|', ('server_type', '!=', 'outlook'), ('microsoft_outlook_refresh_token', '=', False)]}"
|
||||
class="badge text-bg-success">
|
||||
Outlook Token Valid
|
||||
</span>
|
||||
<button type="object"
|
||||
name="open_microsoft_outlook_uri" class="btn-link px-0"
|
||||
attrs="{'invisible': ['|', '|', ('is_microsoft_outlook_configured', '=', False), ('server_type', '!=', 'outlook'), ('microsoft_outlook_refresh_token', '!=', False)]}">
|
||||
<i class="fa fa-arrow-right"/>
|
||||
Connect your Outlook account
|
||||
</button>
|
||||
<button type="object"
|
||||
name="open_microsoft_outlook_uri" class="btn-link px-0 ms-2"
|
||||
attrs="{'invisible': ['|', '|', ('is_microsoft_outlook_configured', '=', False), ('server_type', '!=', 'outlook'), ('microsoft_outlook_refresh_token', '=', False)]}">
|
||||
<i class="fa fa-cog" title="Edit Settings"/>
|
||||
</button>
|
||||
<button class="alert alert-warning d-block mt-2 text-start"
|
||||
icon="fa-arrow-right" type="action" role="alert"
|
||||
name="%(base.res_config_setting_act_window)d"
|
||||
attrs="{'invisible': ['|', ('is_microsoft_outlook_configured', '=', True), ('server_type', '!=', 'outlook')]}">
|
||||
Setup your Outlook API credentials in the general settings to link a Outlook account.
|
||||
</button>
|
||||
</div>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?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.outlook</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_user" position="after">
|
||||
<field name="is_microsoft_outlook_configured" invisible="1"/>
|
||||
<field name="microsoft_outlook_refresh_token" invisible="1"/>
|
||||
<field name="microsoft_outlook_access_token" invisible="1"/>
|
||||
<field name="microsoft_outlook_access_token_expiration" invisible="1"/>
|
||||
<div attrs="{'invisible': [('smtp_authentication', '!=', 'outlook')]}"
|
||||
class="d-flex flex-row align-items-center" colspan="8">
|
||||
<span attrs="{'invisible': ['|', ('smtp_authentication', '!=', 'outlook'), ('microsoft_outlook_refresh_token', '=', False)]}"
|
||||
class="badge text-bg-success">
|
||||
Outlook Token Valid
|
||||
</span>
|
||||
<button type="object"
|
||||
name="open_microsoft_outlook_uri" class="btn-link px-0"
|
||||
attrs="{'invisible': ['|', '|', ('is_microsoft_outlook_configured', '=', False), ('smtp_authentication', '!=', 'outlook'), ('microsoft_outlook_refresh_token', '!=', False)]}">
|
||||
<i class="fa fa-arrow-right"/>
|
||||
Connect your Outlook account
|
||||
</button>
|
||||
<button type="object"
|
||||
name="open_microsoft_outlook_uri" class="btn-link px-0 ms-2"
|
||||
attrs="{'invisible': ['|', '|', ('is_microsoft_outlook_configured', '=', False), ('smtp_authentication', '!=', 'outlook'), ('microsoft_outlook_refresh_token', '=', False)]}">
|
||||
<i class="fa fa-cog" title="Edit Settings"/>
|
||||
</button>
|
||||
<button class="alert alert-warning d-block mt-2 text-start"
|
||||
icon="fa-arrow-right" type="action" role="alert"
|
||||
name="%(base.res_config_setting_act_window)d"
|
||||
attrs="{'invisible': ['|', ('is_microsoft_outlook_configured', '=', True), ('smtp_authentication', '!=', 'outlook')]}">
|
||||
Setup your Outlook API credentials in the general settings to link a Outlook account.
|
||||
</button>
|
||||
</div>
|
||||
</field>
|
||||
<field name="smtp_authentication_info" position="after">
|
||||
<a href="https://www.odoo.com/documentation/16.0/applications/general/email_communication/email_servers.html?highlight=outgoing email server#use-a-default-from-email-address"
|
||||
attrs="{'invisible': [('smtp_authentication', '!=', 'outlook')]}" target="_blank">
|
||||
Read More
|
||||
</a>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="res_config_settings_view_form" model="ir.ui.view">
|
||||
<field name="name">res.config.settings.view.form.inherit.microsoft_outlook</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<div id="msg_module_microsoft_outlook" position="replace">
|
||||
<div class="row mt16" id="outlook_client_identifier">
|
||||
<label string="ID" for="microsoft_outlook_client_identifier"
|
||||
class="col-lg-3 o_light_label"/>
|
||||
<field name="microsoft_outlook_client_identifier" class="ms-2"
|
||||
placeholder="ID of your Outlook app"/>
|
||||
</div>
|
||||
<div class="row mt16" id="outlook_client_secret">
|
||||
<label string="Secret" for="microsoft_outlook_client_secret"
|
||||
class="col-lg-3 o_light_label"/>
|
||||
<field name="microsoft_outlook_client_secret" password="True" class="ms-2"
|
||||
placeholder="Secret of your Outlook app"/>
|
||||
</div>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<template id="microsoft_outlook_oauth_error">
|
||||
<t t-call-assets="web.assets_frontend" t-js="false"/>
|
||||
<div class="py-5">
|
||||
<div class="alert alert-warning w-50 mx-auto" role="alert">
|
||||
<t t-esc="error"/>
|
||||
<br/>
|
||||
<a t-attf-href="/web?#id=#{rec_id}&model=#{model_name}&view_type=form">
|
||||
Go back to your mail server
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue