feat(fusion_helpdesk): owner-approval engagement flow + AI summary + reporting

Ships the design spec at docs/superpowers/specs/2026-05-27-owner-approval-flow-design.md.

What's new on central (fusion_helpdesk_central 19.0.1.2.0 -> 19.0.2.0.0):

- Engagement model: 8 new fields on helpdesk.ticket (state, snapshotted
  owner email/name, single-use UUID4 token, sent/reminded/decided
  timestamps, AI summary, stored-computed turnaround hours).
- Wizard: single + bulk modes on one fusion.helpdesk.engagement.wizard
  TransientModel with a child wizard.line for per-ticket bulk summaries.
  default_get pulls the OpenAI summary on open; AI fan-out for bulk is
  parallel via ThreadPoolExecutor (max 5 workers, 30s overall cap).
- OpenAI client in utils.py — stdlib urllib, 15s per-call timeout, every
  failure collapses to '' so the wizard's manual-summary fallback fires.
- Public portal: /fusion_helpdesk/engagement/<token>/<decision> GET +
  POST, four branded standalone QWeb pages (confirm/done/invalid/error).
  Token is single-use, cleared on confirm. Decision posts a public
  comment attributed to the resolved owner partner; chatter propagates
  to the employee's My Tickets thread per the "fully visible" UX choice.
- Mail templates (single + bulk) with magic-link buttons. Bulk template
  renders one card per ticket, each with its own approve/reject URL.
- Reminder cron: daily, single-shot per engagement, configurable via
  fusion_helpdesk_central.engagement_reminder_days ICP (default 3, 0
  disables).
- Reporting dashboard: pivot/graph/list/kanban over helpdesk.ticket
  filtered to engaged ones, with avg-turnaround measure. Menu lives
  under Helpdesk > Reporting > Owner Engagements.
- Client_key extended with owner_email/owner_name fields; ticket.create
  upserts them from the client-side piggyback (no new sync endpoint).
- 100% coverage on utils + integration tests on wizard, controllers,
  re-engagement, cron, computed turnaround. OpenAI mocked in CI.

What's new on client (fusion_helpdesk 19.0.1.7.1 -> 19.0.2.0.0):

- Two new ICP settings: fusion_helpdesk.owner_email / .owner_name with
  a new "Owner Approval" block in Settings > Fusion Helpdesk.
- controllers/main.py::submit piggybacks both keys on every ticket
  payload so central keeps client_key.owner_email/name fresh
  automatically.

Verified live end-to-end on entech -> nexa: payload upsert, wizard with
mocked AI, action_send, portal GET/POST/GET-again cycle, second click
hits the friendly invalid-token page. Token entropy = 122 bits (UUID4).
This commit is contained in:
gsinghpal
2026-05-27 13:03:23 -04:00
parent eb186cac3c
commit 396170b438
24 changed files with 2346 additions and 7 deletions

View File

@@ -3,7 +3,7 @@
# License OPL-1 (Odoo Proprietary License v1.0)
{
'name': 'Fusion Helpdesk Reporter',
'version': '19.0.1.7.1',
'version': '19.0.2.0.0',
'category': 'Productivity',
'summary': 'One-click in-app bug reporting & feature requesting — '
'auto-creates a helpdesk.ticket on a central Odoo Helpdesk.',

View File

@@ -101,6 +101,15 @@ class FusionHelpdeskController(http.Controller):
company_name=request.env.company.name,
is_critical=bool(is_critical),
)
# Piggyback the configured owner contact on every submission so the
# central can keep fusion.helpdesk.client.key.owner_email/name in
# sync without a dedicated endpoint. The central's create override
# pops these keys before super().create() sees them — they're not
# real helpdesk.ticket columns, just a sync side-channel.
if cfg.get('owner_email'):
ticket_vals['x_fc_owner_email'] = cfg['owner_email']
if cfg.get('owner_name'):
ticket_vals['x_fc_owner_name'] = cfg['owner_name']
# ---- Talk to remote Odoo --------------------------------------
try:
@@ -219,6 +228,12 @@ class FusionHelpdeskController(http.Controller):
'client_label': (
ICP.get_param('fusion_helpdesk.client_label') or ''
).strip(),
'owner_email': (
ICP.get_param('fusion_helpdesk.owner_email') or ''
).strip(),
'owner_name': (
ICP.get_param('fusion_helpdesk.owner_name') or ''
).strip(),
}
def _authenticate(self, cfg):

View File

@@ -50,3 +50,22 @@ class ResConfigSettings(models.TransientModel):
'can tell which client deployment a ticket came from. '
'e.g. "ENTECH""[ENTECH] My subject"',
)
# Owner contact for the central engagement / approval flow. Optional —
# leaving these blank disables the "Request Owner Approval" button on
# the central side for this client. Both values piggyback on every
# ticket submission (see controllers/main.py::submit) so central always
# has the latest contact without a dedicated sync endpoint.
fhd_owner_email = fields.Char(
string='Owner Email',
config_parameter='fusion_helpdesk.owner_email',
help='Email of the real decision-maker at your company — the '
'person who can approve feature requests or bug-fix scope. '
'Used when central support hits a ticket that needs sign-off. '
'Leave blank if your deployment doesn\'t require approvals.',
)
fhd_owner_name = fields.Char(
string='Owner Name',
config_parameter='fusion_helpdesk.owner_name',
help='Display name for the owner — shown in the approval email '
'greeting and in the chatter attribution after they decide.',
)

View File

@@ -43,6 +43,19 @@
<field name="fhd_client_label" placeholder="ENTECH"/>
</setting>
</block>
<block title="Owner Approval"
name="fhd_owner_approval">
<setting id="fhd_owner_name"
string="Owner Name"
help="Display name of the real decision-maker at your company. Used in approval emails and chatter attribution.">
<field name="fhd_owner_name" placeholder="Jane Doe"/>
</setting>
<setting id="fhd_owner_email"
string="Owner Email"
help="Email of the real decision-maker. Used when central support requests approval for a ticket that needs sign-off. Leave blank to disable approval requests for this deployment.">
<field name="fhd_owner_email" placeholder="owner@yourcompany.com"/>
</setting>
</block>
</app>
</xpath>
</field>