ui(process-tree): back to Work Order + pulsing green for done steps

Two improvements to the Process Tree visualization opened from the
Work Order's Process Tree header button:

  1. Back button returns to the Work Order (job form) instead of
     Plant Overview. fp.job.action_open_process_tree now passes
     back_job_id in the client-action context; process_tree.js
     reads it via a new backJobId getter, updates the button label
     to "Back to Work Order", and routes onBack to fp.job form.
     The Plant Overview fallback stays for callers that don't pass
     either back_step_id or back_job_id.

  2. Completed operation/step cards now have a green fill (#1e8449)
     and a subtle pulsing glow (box-shadow animation, 2.6s alternate)
     so finished work pops against still-pending dark cards. Hover
     pauses the animation so the click target is steady. Reuses the
     same green the workflow-state slice already used.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-12 08:13:46 -04:00
parent 798458c834
commit dcbe8305d0
5 changed files with 51 additions and 4 deletions

View File

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

View File

@@ -1064,7 +1064,10 @@ class FpJob(models.Model):
return { return {
'type': 'ir.actions.client', 'type': 'ir.actions.client',
'tag': 'fp_process_tree', 'tag': 'fp_process_tree',
'context': {'job_id': self.id}, 'context': {
'job_id': self.id,
'back_job_id': self.id,
},
'name': 'Process Tree — %s' % (self.name or ''), 'name': 'Process Tree — %s' % (self.name or ''),
'target': 'current', 'target': 'current',
} }

View File

@@ -5,7 +5,7 @@
{ {
'name': 'Fusion Plating — Shop Floor', 'name': 'Fusion Plating — Shop Floor',
'version': '19.0.25.1.0', 'version': '19.0.25.2.0',
'category': 'Manufacturing/Plating', 'category': 'Manufacturing/Plating',
'summary': 'Shop-floor tablet stations, QR scanning, bake window enforcer, ' 'summary': 'Shop-floor tablet stations, QR scanning, bake window enforcer, '
'first-piece inspection gates.', 'first-piece inspection gates.',

View File

@@ -66,8 +66,13 @@ export class ProcessTree extends Component {
get backStepId() { get backStepId() {
return this._ctx.back_step_id || this._ctx.back_workorder_id || null; return this._ctx.back_step_id || this._ctx.back_workorder_id || null;
} }
get backJobId() {
return this._ctx.back_job_id || null;
}
get backLabel() { get backLabel() {
return this.backStepId ? "Back to Step" : "Plant Overview"; if (this.backStepId) return "Back to Step";
if (this.backJobId) return "Back to Work Order";
return "Plant Overview";
} }
// ---- Data --------------------------------------------------------------- // ---- Data ---------------------------------------------------------------
@@ -137,6 +142,17 @@ export class ProcessTree extends Component {
}); });
return; return;
} }
const jobId = this.backJobId;
if (jobId) {
this.action.doAction({
type: "ir.actions.act_window",
res_model: "fp.job",
res_id: parseInt(jobId, 10),
views: [[false, "form"]],
target: "current",
});
return;
}
this.action.doAction("fusion_plating_shopfloor.action_fp_plant_overview"); this.action.doAction("fusion_plating_shopfloor.action_fp_plant_overview");
} }

View File

@@ -228,9 +228,37 @@ $pt-line-width : 2px;
background-color: #1e8449; // green for completed slice background-color: #1e8449; // green for completed slice
color: #fff; color: #fff;
} }
// Operation / step cards that have completed — green fill + subtle
// pulsing glow so finished work pops against the still-pending dark
// cards. Animation pauses on hover so the click target is steady.
&.o_fp_pt_state_done.o_fp_pt_type_operation,
&.o_fp_pt_state_done.o_fp_pt_type_step {
background-color: #1e8449;
color: #fff;
box-shadow: 0 0 0 1px rgba(30, 132, 73, 0.65),
0 0 10px rgba(30, 132, 73, 0.30);
animation: fp_pt_done_glow 2.6s ease-in-out infinite alternate;
&:hover {
animation: none;
box-shadow: 0 0 0 1px rgba(30, 132, 73, 0.85),
0 0 14px rgba(30, 132, 73, 0.55);
}
}
&.o_fp_pt_state_cancel { opacity: 0.55; } &.o_fp_pt_state_cancel { opacity: 0.55; }
} }
@keyframes fp_pt_done_glow {
0% {
box-shadow: 0 0 0 1px rgba(30, 132, 73, 0.50),
0 0 4px rgba(30, 132, 73, 0.18);
}
100% {
box-shadow: 0 0 0 1px rgba(30, 132, 73, 0.85),
0 0 16px rgba(30, 132, 73, 0.55);
}
}
.o_fp_pt_card_icon { .o_fp_pt_card_icon {
flex: 0 0 auto; flex: 0 0 auto;
width: 18px; width: 18px;