mirror of
https://github.com/bringout/oca-ocb-security.git
synced 2026-04-20 11:52:06 +02:00
19.0 vanilla
This commit is contained in:
parent
20ddc1b4a3
commit
c0efcc53f5
1162 changed files with 125577 additions and 105287 deletions
|
|
@ -0,0 +1,28 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ResUsers(models.Model):
|
||||
_inherit = "res.users"
|
||||
|
||||
outgoing_mail_server_type = fields.Selection(
|
||||
selection_add=[("gmail", "Gmail")],
|
||||
ondelete={"gmail": "set default"},
|
||||
)
|
||||
|
||||
@api.model
|
||||
def _get_mail_server_values(self, server_type):
|
||||
values = super()._get_mail_server_values(server_type)
|
||||
if server_type == "gmail":
|
||||
values |= {
|
||||
"smtp_host": "smtp.gmail.com",
|
||||
"smtp_authentication": "gmail",
|
||||
}
|
||||
return values
|
||||
|
||||
@api.model
|
||||
def _get_mail_server_setup_end_action(self, smtp_server):
|
||||
if smtp_server.smtp_authentication == "gmail":
|
||||
return smtp_server.sudo().open_google_gmail_uri()
|
||||
return super()._get_mail_server_setup_end_action(smtp_server)
|
||||
Loading…
Add table
Add a link
Reference in a new issue