Adds a one-click 'loop the owner into the chatter' shortcut on the
ticket form — separate from the engagement approval flow, just keeps
the owner in the loop on ongoing communication.
What's new on helpdesk.ticket:
- x_fc_owner_display (computed Char): 'Kris Pathinather <kris@…>',
read live from fusion.helpdesk.client.key so a change to the owner
contact reflects immediately on every existing ticket.
- x_fc_owner_email_resolved (computed Char): email-only slice, drives
view visibility (the field + button only render when an owner is
configured).
- x_fc_owner_is_follower (computed Boolean): True when a partner with
the owner email is in message_partner_ids. Swaps the button for a
green 'Following' badge when the owner is already on the thread.
- action_add_owner_as_follower(): find-or-create the owner partner by
email and message_subscribe. Idempotent — second call is a no-op,
no duplicate partner. Raises UserError with a clear message if no
owner is configured.
View extension on the helpdesk ticket form: injects right after the
existing partner_id ('Customer') field in the customer side group,
so it reads as 'Customer | Owner Contact [Add as Follower]' — same
row, no layout shift when the state flips to 'Following'.
Tests cover the compute display in three states (configured,
no-client-label, no-owner-on-key), the action's three paths
(create-and-subscribe, reuse-existing-partner, idempotent-when-
already-following), and the UserError when nothing is configured.
Smoke-tested live on nexa: ticket with x_fc_client_label='ENTECH'
displays 'Kris Pathinather <kris@enplating.ca>'; first click adds
res.partner #723 to followers and flips owner_is_follower to True;
second click is a no-op.
Bumps fusion_helpdesk_central to 19.0.2.1.0.
155 lines
7.6 KiB
XML
155 lines
7.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!--
|
|
Copyright 2026 Nexa Systems Inc.
|
|
License OPL-1
|
|
Surface the client-deployment tag in the agent backend so support can
|
|
see + filter tickets by the deployment they came from.
|
|
-->
|
|
<odoo>
|
|
|
|
<record id="fhc_ticket_list_label" model="ir.ui.view">
|
|
<field name="name">fhc.helpdesk.ticket.list.client_label</field>
|
|
<field name="model">helpdesk.ticket</field>
|
|
<field name="inherit_id" ref="helpdesk.helpdesk_tickets_view_tree"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//list" position="inside">
|
|
<field name="x_fc_client_label" optional="show"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="fhc_ticket_search_label" model="ir.ui.view">
|
|
<field name="name">fhc.helpdesk.ticket.search.client_label</field>
|
|
<field name="model">helpdesk.ticket</field>
|
|
<field name="inherit_id" ref="helpdesk.helpdesk_tickets_view_search"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//search" position="inside">
|
|
<field name="x_fc_client_label"/>
|
|
<filter string="Client Deployment" name="group_client_label"
|
|
context="{'group_by': 'x_fc_client_label'}"/>
|
|
<separator/>
|
|
<filter string="Awaiting Owner Approval" name="fhc_pending_engagement"
|
|
domain="[('x_fc_engagement_state', '=', 'pending')]"/>
|
|
<filter string="Owner Approved" name="fhc_approved_engagement"
|
|
domain="[('x_fc_engagement_state', '=', 'approved')]"/>
|
|
<filter string="Owner Rejected" name="fhc_rejected_engagement"
|
|
domain="[('x_fc_engagement_state', '=', 'rejected')]"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<!--
|
|
Inherited ticket form. Adds:
|
|
* Header button "Request Owner Approval" (form-button entry into
|
|
the wizard). Disabled when there's no client_label OR no owner
|
|
contact on the client_key — see the action_open_engagement_wizard
|
|
method which raises a UserError with the same explanation.
|
|
* State pill in the title row showing pending / approved / rejected.
|
|
* Collapsible "Owner Engagement" group with the audit fields.
|
|
Inherited views in Odoo 19 cannot carry `groups`/`group_ids` on the
|
|
record (raises ParseError); per-node `groups=` attributes are fine.
|
|
-->
|
|
<record id="fhc_ticket_form_engagement" model="ir.ui.view">
|
|
<field name="name">fhc.helpdesk.ticket.form.engagement</field>
|
|
<field name="model">helpdesk.ticket</field>
|
|
<field name="inherit_id" ref="helpdesk.helpdesk_ticket_view_form"/>
|
|
<field name="arch" type="xml">
|
|
|
|
<!-- Header button + state badge. Placed at the top of the
|
|
header so it's the first thing support sees. -->
|
|
<xpath expr="//header" position="inside">
|
|
<button name="action_open_engagement_wizard"
|
|
type="object"
|
|
string="Request Owner Approval"
|
|
class="oe_highlight"
|
|
invisible="not x_fc_client_label or x_fc_engagement_state == 'pending'"
|
|
groups="base.group_user"/>
|
|
<button name="action_open_engagement_wizard"
|
|
type="object"
|
|
string="Re-engage Owner"
|
|
invisible="x_fc_engagement_state != 'pending'"
|
|
groups="base.group_user"/>
|
|
<field name="x_fc_engagement_state" widget="statusbar"
|
|
invisible="x_fc_engagement_state == 'none'"
|
|
statusbar_visible="pending,approved,rejected"/>
|
|
</xpath>
|
|
|
|
<!--
|
|
Owner Contact display + Add-as-Follower button in the
|
|
customer side group. Lives next to partner_id (the
|
|
"Customer" field) so it reads naturally as a second
|
|
contact slot. The button vanishes once the owner is
|
|
already following and a green "Following" badge takes
|
|
its place — same row, no layout shift.
|
|
-->
|
|
<xpath expr="//field[@name='partner_id']" position="after">
|
|
<field name="x_fc_owner_email_resolved" invisible="1"/>
|
|
<field name="x_fc_owner_is_follower" invisible="1"/>
|
|
<label for="x_fc_owner_display" string="Owner Contact"
|
|
invisible="not x_fc_owner_email_resolved"/>
|
|
<div class="o_row" invisible="not x_fc_owner_email_resolved">
|
|
<field name="x_fc_owner_display" nolabel="1" readonly="1"/>
|
|
<button name="action_add_owner_as_follower"
|
|
type="object"
|
|
string="Add as Follower"
|
|
icon="fa-user-plus"
|
|
class="btn-link"
|
|
invisible="x_fc_owner_is_follower"/>
|
|
<span invisible="not x_fc_owner_is_follower"
|
|
class="text-success ms-2">
|
|
<i class="fa fa-check-circle me-1"/>Following
|
|
</span>
|
|
</div>
|
|
</xpath>
|
|
|
|
<!-- Collapsible Owner Engagement page on the notebook. -->
|
|
<xpath expr="//notebook" position="inside">
|
|
<page string="Owner Engagement"
|
|
name="fhc_engagement_page"
|
|
invisible="x_fc_engagement_state == 'none'">
|
|
<group>
|
|
<group>
|
|
<field name="x_fc_engagement_state" readonly="1"/>
|
|
<field name="x_fc_engagement_name" readonly="1"/>
|
|
<field name="x_fc_engagement_email" readonly="1" widget="email"/>
|
|
</group>
|
|
<group>
|
|
<field name="x_fc_engagement_sent_at" readonly="1"/>
|
|
<field name="x_fc_engagement_reminded_at" readonly="1"/>
|
|
<field name="x_fc_engagement_decided_at" readonly="1"/>
|
|
<field name="x_fc_engagement_turnaround_hours" readonly="1"/>
|
|
</group>
|
|
</group>
|
|
<separator string="AI Summary (snapshotted at engagement)"/>
|
|
<field name="x_fc_ai_summary" readonly="1" nolabel="1"/>
|
|
</page>
|
|
</xpath>
|
|
|
|
</field>
|
|
</record>
|
|
|
|
<!--
|
|
Kanban dot on the main Helpdesk kanban deferred — the underlying
|
|
view's structure varies between Helpdesk versions and reaching into
|
|
it with xpath is fragile. The Reporting → Owner Engagements kanban
|
|
(grouped by state) gives the same at-a-glance signal until we have
|
|
a stable hook in helpdesk's main kanban.
|
|
-->
|
|
|
|
<!--
|
|
Server action — bulk "Request Owner Approval" available from the
|
|
helpdesk.ticket list view. Validation happens in the wizard's
|
|
default_get; the server action just opens the wizard with the
|
|
selection in context.
|
|
-->
|
|
<record id="action_engagement_bulk" model="ir.actions.server">
|
|
<field name="name">Request Owner Approval (Bulk)</field>
|
|
<field name="model_id" ref="helpdesk.model_helpdesk_ticket"/>
|
|
<field name="binding_model_id" ref="helpdesk.model_helpdesk_ticket"/>
|
|
<field name="binding_view_types">list,kanban</field>
|
|
<field name="state">code</field>
|
|
<field name="code">action = model.action_open_engagement_wizard_bulk()</field>
|
|
</record>
|
|
|
|
</odoo>
|