Initial commit
This commit is contained in:
23
fusion_ringcentral/controllers/widget.py
Normal file
23
fusion_ringcentral/controllers/widget.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2026 Nexa Systems Inc.
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
|
||||
from odoo import http
|
||||
from odoo.http import request
|
||||
|
||||
|
||||
class RcWidgetController(http.Controller):
|
||||
|
||||
@http.route('/ringcentral/widget-config', type='json', auth='user')
|
||||
def widget_config(self, **kw):
|
||||
"""Return RingCentral widget configuration for the JS frontend."""
|
||||
config = request.env['rc.config']._get_active_config()
|
||||
if not config:
|
||||
return {'enabled': False}
|
||||
|
||||
return {
|
||||
'enabled': config.phone_widget_enabled,
|
||||
'client_id': config.client_id,
|
||||
'app_server': config.server_url,
|
||||
'connected': config.state == 'connected',
|
||||
}
|
||||
Reference in New Issue
Block a user