Files
gsinghpal f08f328688 changes
2026-04-27 00:11:18 -04:00

322 lines
17 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Plating product family.
Sub 12 Phase A — RMA list / form / kanban / search + window action.
-->
<odoo>
<!-- ====================================================== LIST -->
<record id="view_fp_rma_list" model="ir.ui.view">
<field name="name">fp.rma.list</field>
<field name="model">fusion.plating.rma</field>
<field name="arch" type="xml">
<list string="RMAs"
decoration-muted="state in ('closed','cancelled')"
decoration-warning="state == 'received'"
decoration-danger="severity == 'critical'">
<field name="name"/>
<field name="create_date" string="Opened"/>
<field name="partner_id"/>
<field name="sale_order_id"/>
<field name="trigger_source"/>
<field name="severity" widget="badge"
decoration-info="severity == 'low'"
decoration-warning="severity == 'high'"
decoration-danger="severity == 'critical'"/>
<field name="qty_returned"/>
<field name="qty_received"/>
<field name="resolution_type" optional="show"/>
<field name="ncr_count" optional="show"/>
<field name="hold_count" optional="show"/>
<field name="state" widget="badge"
decoration-info="state in ('authorised','shipped_to_us')"
decoration-warning="state == 'received'"
decoration-success="state in ('triaged','resolving','resolved')"
decoration-muted="state in ('closed','cancelled')"/>
</list>
</field>
</record>
<!-- ====================================================== FORM -->
<record id="view_fp_rma_form" model="ir.ui.view">
<field name="name">fp.rma.form</field>
<field name="model">fusion.plating.rma</field>
<field name="arch" type="xml">
<form string="Return Material Authorisation">
<header>
<button name="action_authorise" string="Authorise" type="object"
class="oe_highlight" invisible="state != 'draft'"/>
<button name="action_mark_shipped_to_us" string="Mark as Shipped" type="object"
invisible="state != 'authorised'"/>
<button name="action_mark_received" string="Mark Received" type="object"
invisible="state not in ('authorised','shipped_to_us')"
help="Use only if no fp.receiving record was created automatically."/>
<button name="action_triage_complete" string="Triage Complete" type="object"
class="oe_highlight" invisible="state != 'received'"/>
<button name="action_start_resolving" string="Start Resolving" type="object"
invisible="state != 'triaged'"/>
<button name="action_resolve" string="Resolve" type="object"
class="oe_highlight" invisible="state not in ('triaged','resolving')"/>
<button name="action_close" string="Close" type="object"
invisible="state != 'resolved'"/>
<button name="action_cancel" string="Cancel" type="object"
confirm="Cancel this RMA? Manager only."
invisible="state in ('closed','cancelled')"
groups="fusion_plating.group_fusion_plating_manager"/>
<field name="state" widget="statusbar"
statusbar_visible="draft,authorised,shipped_to_us,received,triaged,resolving,resolved,closed"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_sale_order" type="object"
class="oe_stat_button" icon="fa-shopping-cart"
invisible="not sale_order_id">
<div class="o_stat_info">
<span class="o_stat_text">Sale Order</span>
</div>
</button>
<button name="action_view_inbound_receiving" type="object"
class="oe_stat_button" icon="fa-truck"
invisible="not inbound_receiving_id">
<div class="o_stat_info">
<span class="o_stat_text">Inbound</span>
</div>
</button>
<button name="action_view_ncrs" type="object"
class="oe_stat_button" icon="fa-exclamation-triangle">
<field name="ncr_count" widget="statinfo" string="NCRs"/>
</button>
<button name="action_view_holds" type="object"
class="oe_stat_button" icon="fa-hand-paper-o">
<field name="hold_count" widget="statinfo" string="Holds"/>
</button>
<button name="action_view_capas" type="object"
class="oe_stat_button" icon="fa-wrench">
<field name="capa_count" widget="statinfo" string="CAPAs"/>
</button>
<button name="action_view_replacement_job" type="object"
class="oe_stat_button" icon="fa-cogs"
invisible="not replacement_job_id">
<div class="o_stat_info">
<span class="o_stat_text">Replacement Job</span>
</div>
</button>
<button name="action_view_refund" type="object"
class="oe_stat_button" icon="fa-money"
invisible="not refund_invoice_id">
<div class="o_stat_info">
<span class="o_stat_text">Credit Note</span>
</div>
</button>
</div>
<div class="oe_title">
<label for="name"/>
<h1><field name="name" readonly="1"/></h1>
</div>
<group>
<group>
<field name="partner_id" options="{'no_create': True}"/>
<field name="sale_order_id" options="{'no_create': True}"/>
<field name="sale_order_line_ids" widget="many2many_tags"
options="{'no_create': True}"/>
<field name="trigger_source"/>
<field name="severity" widget="badge"
decoration-info="severity == 'low'"
decoration-warning="severity == 'high'"
decoration-danger="severity == 'critical'"/>
</group>
<group>
<field name="qty_returned"/>
<field name="qty_received"/>
<field name="customer_tracking"/>
<field name="our_tracking"/>
<field name="carrier_id"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
<group>
<group string="Categorisation">
<field name="team_id"/>
<field name="reason_id"/>
<field name="stage_id" readonly="1"/>
</group>
<group string="Tags">
<field name="tag_ids" widget="many2many_tags"
options="{'color_field': 'color'}" nolabel="1"/>
</group>
</group>
<group string="Auto-Spawn (manager-overridable)"
groups="fusion_plating.group_fusion_plating_supervisor">
<group>
<field name="auto_spawn_ncr"/>
</group>
<group>
<field name="auto_spawn_hold"/>
</group>
</group>
<notebook>
<page string="Customer Complaint">
<field name="complaint_description"
placeholder="What did the customer report?"/>
</page>
<page string="Triage Findings"
invisible="state in ('draft','authorised','shipped_to_us')">
<field name="triage_findings"
placeholder="What we found on inspection."/>
</page>
<page string="Resolution"
invisible="state in ('draft','authorised','shipped_to_us','received')">
<group>
<group>
<field name="resolution_type"/>
<field name="replacement_job_id"
invisible="resolution_type not in ('replace','rework')"/>
</group>
<group>
<field name="refund_invoice_id"
invisible="resolution_type != 'refund'"/>
</group>
</group>
<field name="resolution_notes" placeholder="Notes on the chosen resolution path."/>
</page>
<page string="Linked NCRs"
invisible="not linked_ncr_ids">
<field name="linked_ncr_ids" readonly="1">
<list>
<field name="name"/>
<field name="severity" widget="badge"/>
<field name="state" widget="badge"/>
<field name="capa_count"/>
</list>
</field>
</page>
<page string="Linked Holds"
invisible="not linked_hold_ids">
<field name="linked_hold_ids" readonly="1">
<list>
<field name="name"/>
<field name="part_ref"/>
<field name="qty_on_hold"/>
<field name="hold_reason"/>
<field name="state" widget="badge"/>
</list>
</field>
</page>
<page string="QR Code">
<group>
<field name="qr_code" widget="image"
options="{'size': [200, 200]}"
nolabel="1"/>
</group>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<!-- ====================================================== KANBAN -->
<record id="view_fp_rma_kanban" model="ir.ui.view">
<field name="name">fp.rma.kanban</field>
<field name="model">fusion.plating.rma</field>
<field name="arch" type="xml">
<kanban default_group_by="state" class="o_fp_rma_kanban">
<field name="id"/>
<field name="name"/>
<field name="partner_id"/>
<field name="severity"/>
<field name="resolution_type"/>
<field name="qty_returned"/>
<field name="ncr_count"/>
<field name="hold_count"/>
<templates>
<t t-name="card">
<div class="o_fp_card o_fp_rma_card"
t-att-data-severity="record.severity.raw_value">
<div class="d-flex justify-content-between align-items-start">
<strong class="o_fp_card_title"><field name="name"/></strong>
<span class="o_fp_severity_pill"
t-att-data-severity="record.severity.raw_value">
<field name="severity"/>
</span>
</div>
<div class="small mt-1">
<i class="fa fa-user me-1"/><field name="partner_id"/>
</div>
<div class="small text-muted mt-1"
t-if="record.resolution_type.raw_value">
<i class="fa fa-wrench me-1"/><field name="resolution_type"/>
</div>
<div class="d-flex justify-content-between mt-2 small">
<span class="text-muted">Returned</span>
<span class="fw-bold"><field name="qty_returned"/></span>
</div>
<div class="d-flex justify-content-between small">
<span class="text-muted">NCRs / Holds</span>
<span class="fw-bold">
<field name="ncr_count"/> /
<field name="hold_count"/>
</span>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- ====================================================== SEARCH -->
<record id="view_fp_rma_search" model="ir.ui.view">
<field name="name">fp.rma.search</field>
<field name="model">fusion.plating.rma</field>
<field name="arch" type="xml">
<search string="RMAs">
<field name="name"/>
<field name="partner_id"/>
<field name="sale_order_id"/>
<separator/>
<filter string="Open" name="open"
domain="[('state','in',['draft','authorised','shipped_to_us','received','triaged','resolving'])]"/>
<filter string="Closed" name="closed"
domain="[('state','=','closed')]"/>
<filter string="Critical" name="critical"
domain="[('severity','=','critical')]"/>
<filter string="Awaiting Receipt" name="awaiting_receipt"
domain="[('state','in',['authorised','shipped_to_us'])]"/>
<filter string="Awaiting Triage" name="awaiting_triage"
domain="[('state','=','received')]"/>
<separator/>
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
<group>
<filter string="Status" name="g_state" context="{'group_by':'state'}"/>
<filter string="Customer" name="g_partner" context="{'group_by':'partner_id'}"/>
<filter string="Trigger" name="g_trigger" context="{'group_by':'trigger_source'}"/>
<filter string="Resolution" name="g_resolution" context="{'group_by':'resolution_type'}"/>
</group>
</search>
</field>
</record>
<!-- ====================================================== ACTION -->
<record id="action_fp_rma" model="ir.actions.act_window">
<field name="name">RMAs</field>
<field name="res_model">fusion.plating.rma</field>
<field name="view_mode">kanban,list,form</field>
<field name="search_view_id" ref="view_fp_rma_search"/>
<field name="context">{'search_default_open': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Open the first Return Material Authorisation
</p>
<p>RMAs track customer returns, inspection on receipt, root-cause
triage, and resolution (replace / rework / refund / scrap). They
auto-spawn NCRs and Holds when the parts arrive at the shop.</p>
</field>
</record>
</odoo>