feat(plating-jobs): state-aware sort + default Open filter on Plating Jobs

The Plating Jobs list was sorted priority-desc, deadline-asc, id-desc — which
mixed Done (closed) jobs in with Confirmed (open) jobs and made the list look
chaotic to managers. Done jobs from weeks ago surfaced above active work.

Two changes:

1. New stored compute fp.job.state_priority (Integer, indexed) ranks states
   by managerial relevance: in_progress=0, confirmed=1, draft=2, on_hold=3,
   done=4, cancelled=5. _order now leads with state_priority asc, then
   priority desc, then date_deadline asc, then id desc. Active work bubbles
   to the top automatically.

2. Plating Jobs action defaults to a new 'Open' filter
   (state not in done, cancelled). Managers see only active work by default;
   they untick the filter to see history. Added On Hold + Cancelled filters
   too for full state coverage.

Verified on entech: top 10 jobs are now all in_progress, sorted by deadline
ascending. Existing 26-row list goes from chaotic to focused.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-29 23:48:34 -04:00
parent f7fcd03bfc
commit f990f29019
3 changed files with 40 additions and 2 deletions

View File

@@ -100,10 +100,18 @@
<field name="name"/>
<field name="partner_id"/>
<separator/>
<!-- Sub 12d — "Open" is the default surface managers want.
Hides Done + Cancelled jobs out of the box; the
other state filters below let them be re-included. -->
<filter name="open_jobs" string="Open"
domain="[('state','not in',('done','cancelled'))]"/>
<separator/>
<filter name="state_draft" string="Draft" domain="[('state','=','draft')]"/>
<filter name="state_confirmed" string="Confirmed" domain="[('state','=','confirmed')]"/>
<filter name="state_in_progress" string="In Progress" domain="[('state','=','in_progress')]"/>
<filter name="state_on_hold" string="On Hold" domain="[('state','=','on_hold')]"/>
<filter name="state_done" string="Done" domain="[('state','=','done')]"/>
<filter name="state_cancelled" string="Cancelled" domain="[('state','=','cancelled')]"/>
<separator/>
<filter name="rush" string="Rush" domain="[('priority','=','rush')]"/>
<group>
@@ -120,5 +128,8 @@
<field name="res_model">fp.job</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="view_fp_job_search"/>
<!-- Default to the Open filter so Done jobs don't clutter the
managerial surface. Users can untick to see history. -->
<field name="context">{'search_default_open_jobs': 1}</field>
</record>
</odoo>