feat(jobs): Sub 14 polish — workflow state form layout + Simple Editor field

Two follow-ups on the workflow state work:

1) Form layout
   The "How triggers combine" help text was crammed into a 2-column
   group, taking ~25% of the available width. Pulled it out of the
   group and rendered as a full-width <div class="alert alert-info">
   below the trigger fields. Same fix applied to Notes — uses a
   <separator> + bare <field> for full sheet width.

2) Simple Recipe Editor support
   The trigger field was only exposed in the Tree Editor. Added it
   to the Simple Editor's inline library form too:

   * fp.step.template.triggers_workflow_state_id (new Many2one) —
     per-template default, snapshot-copied to recipe nodes when
     dropped into a recipe (added to _SNAPSHOT_FIELDS).
   * /fp/simple_recipe/workflow_states/list — new endpoint to feed
     the dropdown. Soft-fails when fusion_plating_jobs isn't
     installed (returns []).
   * Library editor JS — _fpEnsureWorkflowStatesLoaded helper
     caches the catalog on first open (create + edit paths both
     warm it). Save vals carry the trigger id.
   * Library editor XML — dropdown rendered after the flag
     checkboxes. Hidden when the catalog is empty so the form
     doesn't show a useless "— None —" pick.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-04 00:04:59 -04:00
parent 28bf6b5071
commit e54ffe7309
7 changed files with 157 additions and 19 deletions

View File

@@ -3,7 +3,7 @@
# License OPL-1 (Odoo Proprietary License v1.0)
{
'name': 'Fusion Plating — Native Jobs',
'version': '19.0.8.18.2',
'version': '19.0.8.18.3',
'category': 'Manufacturing/Plating',
'summary': 'Native plating job model — replaces mrp.production / mrp.workorder bridge.',
'author': 'Nexa Systems Inc.',

View File

@@ -43,6 +43,7 @@
<label for="name"/>
<h1><field name="name" placeholder="Received"/></h1>
</div>
<group>
<group string="Identity">
<field name="code" placeholder="received"/>
@@ -56,27 +57,53 @@
<field name="block_when_quality_hold"/>
</group>
</group>
<group string="Trigger conditions">
<separator string="Trigger Conditions"/>
<group>
<field name="trigger_default_kinds"
placeholder="receiving, inspect"/>
<field name="trigger_first_step_started"/>
<field name="trigger_all_steps_done"/>
<p class="text-muted oe_grey mt-2">
<strong>How triggers combine:</strong> a state is "passed"
when EITHER the special trigger is true, OR every
recipe step matching the listed default_kinds (or
tagged via the per-node override on the recipe) is
in done/skipped/cancelled state.
<br/>
<em>block_when_quality_hold</em>: holds back the
advance even if the trigger conditions are met,
until all open quality holds on the job are closed.
</group>
<!-- Help block — full sheet width, alert-info card so
the explanation is readable instead of squeezed
into a 2-column form layout. -->
<div class="alert alert-info mt-3" role="alert">
<h6 class="alert-heading mb-2">
<i class="fa fa-info-circle me-2"/>
How triggers combine
</h6>
<p class="mb-2">
A state is <strong>"passed"</strong> when
<strong>either</strong>:
</p>
</group>
<group string="Notes">
<field name="description" nolabel="1"
placeholder="What this milestone represents and when it should fire..."/>
</group>
<ul class="mb-2">
<li>
The special trigger is true
(<code>trigger_first_step_started</code> or
<code>trigger_all_steps_done</code>),
<strong>OR</strong>
</li>
<li>
Every recipe step matching the listed
<code>trigger_default_kinds</code> (or tagged
via the per-node override on the recipe) is
in <code>done</code> / <code>skipped</code> /
<code>cancelled</code> state.
</li>
</ul>
<p class="mb-0">
<strong>Blocked by Quality Hold:</strong> holds
back the advance even if the trigger conditions
are met, until all open quality holds on the job
are closed.
</p>
</div>
<separator string="Notes"/>
<field name="description" nolabel="1"
placeholder="What this milestone represents and when it should fire..."/>
</sheet>
</form>
</field>