Files
Odoo-Modules/fusion_helpdesk/views/res_config_settings_views.xml
gsinghpal 15470426eb refactor(fusion_helpdesk): owner contact is a res.partner, not two text fields
Smaller UX simplification on the client side: the owner is already a
contact in entech's address book, so picking one is faster + safer than
re-typing their email and name (and avoids typos creeping into the
approval-email To: header).

What changed:
- Entech settings: drop fhd_owner_email + fhd_owner_name char fields;
  add fhd_owner_partner_id Many2one to res.partner exposed in the
  same "Owner Approval" block as a single partner selector. Quick-create
  + create-and-edit kept enabled so admins can spin up a new partner
  inline if the owner isn't already in the system.
- controllers/main.py::_read_config: derives owner_email + owner_name
  from the selected partner via the new _resolve_owner_contact helper.
  Missing / dangling partner id → blank email + name → central simply
  won't see the keys and the Engage button stays disabled (correct
  "not configured" behaviour).
- Nexa side: ZERO changes. Still receives owner_email + owner_name
  strings on the ticket payload, still upserts client_key.owner_email/
  name. The partner abstraction stops at the entech boundary.
- migrations/19.0.2.1.0/post-migration.py auto-resolves the legacy
  fusion_helpdesk.owner_email ICP value to an existing res.partner
  (lowest-id match on lowercased email), writes the new
  fusion_helpdesk.owner_partner_id key, and deletes the obsolete
  owner_email + owner_name ICP rows so a future reader doesn't trip
  over stale config.

Verified live on entech: kris@enplating.ca → res.partner #2308 ("Kris
Pathinather"), legacy keys purged, controller._resolve_owner_contact
returns the expected (email, name). The piggyback payload is unchanged
so existing client_key sync continues to work without a central
redeploy.

Bumps fusion_helpdesk to 19.0.2.1.0. fusion_helpdesk_central stays at
19.0.2.0.0 (no central-side changes required).
2026-05-27 13:21:08 -04:00

62 lines
3.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 Nexa Systems Inc.
License OPL-1
-->
<odoo>
<record id="res_config_settings_view_form_fhd" model="ir.ui.view">
<field name="name">res.config.settings.view.form.fusion.helpdesk</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"
string="Fusion Helpdesk"
name="fusion_helpdesk">
<block title="Central Helpdesk Endpoint"
name="fhd_endpoint">
<setting id="fhd_remote_url"
string="Remote URL"
help="Base URL of the Odoo instance running the Helpdesk app.">
<field name="fhd_remote_url" placeholder="https://erp.nexasystems.ca"/>
</setting>
<setting id="fhd_remote_db"
string="Remote Database">
<field name="fhd_remote_db" placeholder="nexamain"/>
</setting>
<setting id="fhd_remote_login"
string="Service Login">
<field name="fhd_remote_login" placeholder="support@nexasystems.ca"/>
</setting>
<setting id="fhd_remote_password"
string="Service Password / API Key">
<field name="fhd_remote_password" password="True"/>
</setting>
<setting id="fhd_remote_team_id"
string="Helpdesk Team ID (optional)">
<field name="fhd_remote_team_id"/>
</setting>
<setting id="fhd_client_label"
string="Client Label"
help="Tag prefixed to every ticket subject so support can identify the source deployment.">
<field name="fhd_client_label" placeholder="ENTECH"/>
</setting>
</block>
<block title="Owner Approval"
name="fhd_owner_approval">
<setting id="fhd_owner_partner_id"
string="Owner Contact"
help="Pick the real decision-maker at your company from your existing contacts. Used when central support requests approval for a ticket that needs sign-off. Their email and name are sent automatically. Leave blank to disable approval requests for this deployment.">
<field name="fhd_owner_partner_id"
options="{'no_create_edit': False, 'no_quick_create': False}"
placeholder="Pick an owner contact…"/>
</setting>
</block>
</app>
</xpath>
</field>
</record>
</odoo>