mirror of
https://github.com/bringout/oca-ocb-technical.git
synced 2026-04-25 08:52:06 +02:00
19.0 vanilla
This commit is contained in:
parent
5faf7397c5
commit
2696f14ed7
721 changed files with 220375 additions and 91221 deletions
|
|
@ -1,8 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
from odoo.addons.base.models.ir_module import assert_log_admin_access
|
||||
from odoo.tools import str2bool
|
||||
|
||||
|
||||
class CalendarProviderConfig(models.TransientModel):
|
||||
|
|
@ -21,12 +21,18 @@ class CalendarProviderConfig(models.TransientModel):
|
|||
cal_client_secret = fields.Char(
|
||||
"Google Client_key",
|
||||
default=lambda self: self.env['ir.config_parameter'].get_param('google_calendar_client_secret'))
|
||||
cal_sync_paused = fields.Boolean(
|
||||
"Google Synchronization Paused",
|
||||
default=lambda self: str2bool(self.env['ir.config_parameter'].get_param('google_calendar_sync_paused'), default=False))
|
||||
microsoft_outlook_client_identifier = fields.Char(
|
||||
"Outlook Client Id",
|
||||
default=lambda self: self.env['ir.config_parameter'].get_param('microsoft_calendar_client_id'))
|
||||
microsoft_outlook_client_secret = fields.Char(
|
||||
"Outlook Client Secret",
|
||||
default=lambda self: self.env['ir.config_parameter'].get_param('microsoft_calendar_client_secret'))
|
||||
microsoft_outlook_sync_paused = fields.Boolean(
|
||||
"Outlook Synchronization Paused",
|
||||
default=lambda self: str2bool(self.env['ir.config_parameter'].get_param('microsoft_calendar_sync_paused'), default=False))
|
||||
|
||||
@assert_log_admin_access
|
||||
def action_calendar_prepare_external_provider_sync(self):
|
||||
|
|
@ -45,6 +51,8 @@ class CalendarProviderConfig(models.TransientModel):
|
|||
if self.external_calendar_provider == 'google':
|
||||
self.env['ir.config_parameter'].set_param('google_calendar_client_id', self.cal_client_id)
|
||||
self.env['ir.config_parameter'].set_param('google_calendar_client_secret', self.cal_client_secret)
|
||||
self.env['ir.config_parameter'].set_param('google_calendar_sync_paused', self.cal_sync_paused)
|
||||
elif self.external_calendar_provider == 'microsoft':
|
||||
self.env['ir.config_parameter'].set_param('microsoft_calendar_client_id', self.microsoft_outlook_client_identifier)
|
||||
self.env['ir.config_parameter'].set_param('microsoft_calendar_client_secret', self.microsoft_outlook_client_secret)
|
||||
self.env['ir.config_parameter'].set_param('microsoft_calendar_sync_paused', self.microsoft_outlook_sync_paused)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue