feat(fusion_helpdesk_central): expose OpenAI key + cron settings in UI

Adding the 'Fusion Helpdesk Central' block to General Settings so the
three ICP keys the engagement flow reads are configurable from a real
form instead of forcing admins to open Technical → System Parameters.

Three settings, all wired via config_parameter= so the existing read
paths (engagement_wizard, _fc_send_engagement_reminders) keep working
unchanged:

- fusion_helpdesk_central.openai_api_key (password widget — doesn't
  render plaintext on the form)
- fusion_helpdesk_central.openai_model (default 'gpt-4o-mini')
- fusion_helpdesk_central.engagement_reminder_days (default 3, 0
  disables the reminder cron entirely)

Bumps fusion_helpdesk_central to 19.0.2.2.0.

Find under Settings → Fusion Helpdesk Central. The block has two
sub-sections: "Owner Approval — AI Summary" (key + model) and
"Owner Approval — Reminder Cadence" (days).
This commit is contained in:
gsinghpal
2026-05-27 13:36:44 -04:00
parent 6f060896bf
commit 52849777dd
4 changed files with 100 additions and 1 deletions

View File

@@ -3,7 +3,7 @@
# License OPL-1
{
'name': 'Fusion Helpdesk Central — Client API Keys',
'version': '19.0.2.1.0',
'version': '19.0.2.2.0',
'category': 'Productivity',
'summary': 'Admin UI on the central Odoo for issuing per-client API '
'keys used by fusion_helpdesk client deployments.',
@@ -37,6 +37,7 @@ Depends only on `helpdesk`. No client-side install needed.
'views/engagement_wizard_views.xml',
'views/engagement_reporting_views.xml',
'views/portal_templates.xml',
'views/res_config_settings_views.xml',
],
'installable': True,
'auto_install': False,

View File

@@ -2,3 +2,4 @@
from . import fusion_helpdesk_client_key
from . import helpdesk_ticket
from . import engagement_wizard
from . import res_config_settings

View File

@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# License OPL-1
"""Settings for fusion_helpdesk_central exposed via General Settings.
Surfaces the three ICP keys the engagement flow reads — OpenAI key /
model / reminder cadence — so admins don't have to dig into Technical →
System Parameters to set up the AI summary or change the reminder
window. All three are stored in ir.config_parameter via the
`config_parameter=` shortcut so the existing read paths
(engagement_wizard, helpdesk_ticket._fc_send_engagement_reminders)
continue to work unchanged.
"""
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
fhc_openai_api_key = fields.Char(
string='OpenAI API Key',
config_parameter='fusion_helpdesk_central.openai_api_key',
help='Server-side key the engagement wizard uses to generate AI '
'summaries on Engage. Leave blank to disable AI summaries — '
'the wizard still works, you just write the brief manually. '
'Keep secret: anyone with access to System Parameters could '
'read it back.',
)
fhc_openai_model = fields.Char(
string='OpenAI Model',
config_parameter='fusion_helpdesk_central.openai_model',
default='gpt-4o-mini',
help='OpenAI model used for the engagement summary. Default '
'gpt-4o-mini balances cost and quality — switch to gpt-4o '
'or gpt-4o-2024-08-06 if you find summaries too thin.',
)
fhc_engagement_reminder_days = fields.Integer(
string='Reminder After (days)',
config_parameter='fusion_helpdesk_central.engagement_reminder_days',
default=3,
help='Days of inaction before the cron sends a single follow-up '
'reminder to the owner. Set to 0 to disable reminders '
'entirely. The cron sends at most one reminder per '
'engagement regardless of this value.',
)

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 Nexa Systems Inc.
License OPL-1
General Settings → Fusion Helpdesk Central. Surfaces the three ICP
keys that drive the engagement flow's AI summary + reminder cron.
Password widget on the API key so it doesn't render in plaintext on
the settings form (still recoverable via System Parameters, but at
least it's not over-the-shoulder visible).
-->
<odoo>
<record id="res_config_settings_view_form_fhc" model="ir.ui.view">
<field name="name">res.config.settings.view.form.fusion.helpdesk.central</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<app data-string="Fusion Helpdesk Central"
string="Fusion Helpdesk Central"
name="fusion_helpdesk_central">
<block title="Owner Approval — AI Summary"
name="fhc_openai">
<setting id="fhc_openai_api_key"
string="OpenAI API Key"
help="Used by the 'Request Owner Approval' wizard to auto-generate the brief shown to the owner. Leave blank to disable AI summary — the wizard still works, you write the brief manually.">
<field name="fhc_openai_api_key"
password="True"
placeholder="sk-…"/>
</setting>
<setting id="fhc_openai_model"
string="OpenAI Model"
help="Default gpt-4o-mini is cheap (~$0.15/M input tokens) and fast. Bump to gpt-4o if summaries are too thin.">
<field name="fhc_openai_model"
placeholder="gpt-4o-mini"/>
</setting>
</block>
<block title="Owner Approval — Reminder Cadence"
name="fhc_reminder">
<setting id="fhc_engagement_reminder_days"
string="Send reminder after (days)"
help="Days the cron waits before sending a single follow-up reminder on a pending engagement. 0 disables reminders. The cron sends AT MOST ONE reminder per engagement regardless of value — re-engaging the same ticket resets the clock.">
<field name="fhc_engagement_reminder_days"/>
</setting>
</block>
</app>
</xpath>
</field>
</record>
</odoo>