Files
Odoo-Modules/fusion_plating/fusion_plating/views/fp_process_node_views.xml
gsinghpal 625f6560f1 feat(plating): split templates vs part-scoped processes + Process smart button
Two user-reported gaps:

1. The Process Recipes list was about to be flooded by part-scoped
   clones as soon as parts started carrying customised processes —
   thousands of clones would bury the handful of real shared
   templates (General Processing, Anodize, etc.).

   Fix: the main Process Recipes action now narrows to
   part_catalog_id = False so shared templates stay alone in that
   view. A sibling menu "Part Processes" (Plating → Operations →
   Part Processes) shows the inverse list — every part-cloned
   process, grouped by part — so admins can audit clones without
   cluttering the templates list.

   Search view gains two toggle filters (Shared Templates /
   Part-Scoped) and a "Group by Part" option. The node list gains
   an optional "Part" column.

   Split across modules: core owns the base search / tree / action
   (unchanged); configurator owns all the part_catalog_id-dependent
   pieces (filter extensions, list column, narrower domain,
   "Part Processes" action + menu). Keeps the dependency direction
   clean — configurator always depends on core, never the other way.

2. Added a "Process" smart button to the part form's button box.
   Shows either a green check (composed) or "None" (not yet
   composed) and opens the part-scoped Composer on click. Gives
   users one-tap access from any part form without hunting through
   the Process tab.

fusion_plating → 19.0.8.0.0
fusion_plating_configurator → 19.0.13.1.0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 08:45:24 -04:00

210 lines
10 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.
-->
<odoo>
<!-- ===== TREE (LIST) VIEW — Recipes only ===== -->
<record id="view_fp_process_node_tree" model="ir.ui.view">
<field name="name">fusion.plating.process.node.tree</field>
<field name="model">fusion.plating.process.node</field>
<field name="arch" type="xml">
<list string="Process Recipes" default_order="sequence, name">
<field name="sequence" widget="handle"/>
<field name="code" optional="show"/>
<field name="name"/>
<field name="node_type" widget="badge"
decoration-info="node_type == 'recipe'"
decoration-success="node_type == 'operation'"
decoration-warning="node_type == 'sub_process'"
decoration-muted="node_type == 'step'"/>
<field name="process_type_id" optional="show"/>
<field name="work_center_id" optional="show"/>
<field name="child_count" string="Steps"/>
<field name="version" optional="hide"/>
<field name="active" column_invisible="True"/>
</list>
</field>
</record>
<!-- ===== FORM VIEW ===== -->
<record id="view_fp_process_node_form" model="ir.ui.view">
<field name="name">fusion.plating.process.node.form</field>
<field name="model">fusion.plating.process.node</field>
<field name="arch" type="xml">
<form string="Process Node">
<header>
<button name="action_open_tree_editor" type="object"
string="Open Tree Editor" class="btn-primary"
icon="fa-sitemap"
invisible="node_type != 'recipe'"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_open_tree_editor" type="object"
class="oe_stat_button" icon="fa-sitemap"
invisible="node_type != 'recipe'">
<field name="child_count" widget="statinfo"
string="Steps"/>
</button>
</div>
<widget name="web_ribbon" title="Archived"
bg_color="text-bg-danger"
invisible="active"/>
<div class="oe_title">
<h1>
<field name="name" placeholder="Node name..."/>
</h1>
</div>
<group>
<group string="Classification">
<field name="code"/>
<field name="node_type"/>
<field name="process_type_id"/>
<field name="work_center_id"/>
<field name="parent_id"/>
<field name="icon"/>
</group>
<group string="Behaviour">
<field name="sequence"/>
<field name="estimated_duration"/>
<field name="auto_complete"/>
<field name="customer_visible"/>
<field name="is_manual"/>
<field name="requires_signoff"/>
<field name="opt_in_out"/>
<field name="version"/>
<field name="active" invisible="True"/>
</group>
</group>
<!-- Recipe-only metadata (lead time, product link,
contract review approvers). Hidden on
operation/step nodes since those values are
only meaningful at the recipe root. -->
<group string="Recipe Settings"
invisible="node_type != 'recipe'">
<group>
<field name="default_lead_time"
widget="float_time"/>
<field name="product_id"
options="{'no_create': True}"/>
</group>
<group>
<field name="contract_review_user_ids"
widget="many2many_tags"
options="{'no_create': True}"/>
</group>
</group>
<group>
<group string="Tracking">
<field name="create_date" string="Created"/>
<field name="create_uid" string="Created By"/>
<field name="write_date" string="Last Updated"/>
<field name="write_uid" string="Updated By"/>
</group>
</group>
<notebook>
<page string="Description" name="description">
<field name="description" widget="html"/>
</page>
<page string="Operator Inputs" name="inputs">
<field name="input_ids">
<list editable="bottom">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="input_type"/>
<field name="required"/>
<field name="hint"/>
<field name="uom"/>
<field name="selection_options"
invisible="input_type != 'selection'"/>
</list>
</field>
</page>
<page string="Child Steps" name="children">
<field name="child_ids">
<list default_order="sequence, name">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="node_type" widget="badge"/>
<field name="work_center_id"/>
<field name="estimated_duration"/>
<field name="child_count" string="Sub-Steps"/>
</list>
</field>
</page>
<page string="Notes" name="notes">
<field name="notes" placeholder="Internal notes..."/>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<!-- ===== SEARCH VIEW ===== -->
<record id="view_fp_process_node_search" model="ir.ui.view">
<field name="name">fusion.plating.process.node.search</field>
<field name="model">fusion.plating.process.node</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="code"/>
<field name="process_type_id"/>
<field name="work_center_id"/>
<filter name="recipes_only" string="Recipes"
domain="[('node_type', '=', 'recipe')]"/>
<filter name="sub_processes" string="Sub-Processes"
domain="[('node_type', '=', 'sub_process')]"/>
<filter name="operations" string="Operations"
domain="[('node_type', '=', 'operation')]"/>
<separator/>
<filter name="archived" string="Archived"
domain="[('active', '=', False)]"/>
<filter name="group_type" string="Type"
context="{'group_by': 'node_type'}"/>
<filter name="group_process" string="Process Type"
context="{'group_by': 'process_type_id'}"/>
<filter name="group_wc" string="Work Centre"
context="{'group_by': 'work_center_id'}"/>
<!-- Part-scoped filters live in fusion_plating_configurator;
the part_catalog_id field is declared there (core
can't see it without a circular dep). -->
</search>
</field>
</record>
<!-- ===== WINDOW ACTION — Recipe list ===== -->
<!-- Domain only narrows by node_type in core. The configurator
module adds the part_catalog_id = False narrowing via a
view/action inherit (see fusion_plating_configurator). -->
<record id="action_fp_process_recipe" model="ir.actions.act_window">
<field name="name">Process Recipes</field>
<field name="res_model">fusion.plating.process.node</field>
<field name="view_mode">list,form</field>
<field name="domain">[('node_type', '=', 'recipe')]</field>
<field name="context">{'default_node_type': 'recipe', 'search_default_recipes_only': 1}</field>
<field name="search_view_id" ref="view_fp_process_node_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create your first process recipe
</p>
<p>
Recipes define the step-by-step process for plating parts.
Each recipe is a reusable template with nested operations
and sub-processes.
</p>
</field>
</record>
<!-- ===== CLIENT ACTION — OWL Tree Editor ===== -->
<record id="action_fp_recipe_tree_editor" model="ir.actions.client">
<field name="name">Recipe Tree Editor</field>
<field name="tag">fp_recipe_tree_editor</field>
</record>
</odoo>