feat(fusion_plating_shopfloor): WorkflowChip shared OWL service + dark-mode SCSS
Plan task P1.3. Bootstraps the tests/ dir and adds the first of 5 shared OWL services. Pill renders fp.job.workflow.state with color mapping + optional next-action hint. Per CLAUDE.md "Dark Mode" rule: registered once in web.assets_backend; Odoo 19 auto-compiles into both bright and dark bundles via the \$o-webclient-color-scheme SCSS branch. Version bumped to 19.0.27.0.0 (Phase 1 — Workspace foundation). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
{
|
||||
'name': 'Fusion Plating — Shop Floor',
|
||||
'version': '19.0.26.2.0',
|
||||
'version': '19.0.27.0.0',
|
||||
'category': 'Manufacturing/Plating',
|
||||
'summary': 'Shop-floor tablet stations, QR scanning, bake window enforcer, '
|
||||
'first-piece inspection gates.',
|
||||
@@ -62,6 +62,12 @@ Copyright (c) 2026 Nexa Systems Inc. All rights reserved.
|
||||
# and variables directly (Odoo 19 forbids @import in custom SCSS,
|
||||
# so tokens are resolved via bundle concatenation order).
|
||||
'fusion_plating_shopfloor/static/src/scss/_fp_shopfloor_tokens.scss',
|
||||
# ---- Shared OWL services (Phase 1 — tablet redesign) ----
|
||||
# Registered ONCE in web.assets_backend; Odoo 19 auto-compiles
|
||||
# into BOTH bright and dark bundles via $o-webclient-color-scheme.
|
||||
'fusion_plating_shopfloor/static/src/scss/components/_workflow_chip.scss',
|
||||
'fusion_plating_shopfloor/static/src/xml/components/workflow_chip.xml',
|
||||
'fusion_plating_shopfloor/static/src/js/components/workflow_chip.js',
|
||||
'fusion_plating_shopfloor/static/src/scss/qr_scanner.scss',
|
||||
'fusion_plating_shopfloor/static/src/scss/fusion_plating_shopfloor.scss',
|
||||
'fusion_plating_shopfloor/static/src/scss/plant_overview.scss',
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/** @odoo-module **/
|
||||
// =============================================================================
|
||||
// Fusion Plating — WorkflowChip (shared OWL service)
|
||||
//
|
||||
// Renders an fp.job.workflow.state as a colored pill + optional next-action
|
||||
// hint. Used by KanbanCard, JobWorkspace header, Manager Funnel.
|
||||
//
|
||||
// Props:
|
||||
// state : { id, name, color } — required
|
||||
// nextActionLabel : string — optional
|
||||
//
|
||||
// Color map mirrors the fp.job.workflow.state.color Selection
|
||||
// (grey/blue/cyan/yellow/orange/green/success/danger/purple).
|
||||
// =============================================================================
|
||||
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class WorkflowChip extends Component {
|
||||
static template = "fusion_plating_shopfloor.WorkflowChip";
|
||||
static props = {
|
||||
state: { type: Object, optional: false },
|
||||
nextActionLabel: { type: String, optional: true },
|
||||
};
|
||||
|
||||
get toneClass() {
|
||||
const map = {
|
||||
grey: "muted",
|
||||
blue: "info",
|
||||
cyan: "info",
|
||||
yellow: "warning",
|
||||
orange: "warning",
|
||||
green: "success",
|
||||
success: "success",
|
||||
danger: "danger",
|
||||
purple: "info",
|
||||
};
|
||||
return map[this.props.state.color] || "muted";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
// =============================================================================
|
||||
// WorkflowChip — colored milestone pill
|
||||
// Dark-mode aware via $o-webclient-color-scheme branch (registered in BOTH
|
||||
// web.assets_backend AND web.assets_web_dark — see manifest).
|
||||
// =============================================================================
|
||||
|
||||
$o-webclient-color-scheme: bright !default;
|
||||
|
||||
$_wf-bg-muted-hex: #f0f0f2;
|
||||
$_wf-bg-info-hex: rgba(0, 113, 227, 0.15);
|
||||
$_wf-bg-success-hex: rgba(52, 199, 89, 0.15);
|
||||
$_wf-bg-warning-hex: rgba(255, 159, 10, 0.15);
|
||||
$_wf-bg-danger-hex: rgba(255, 59, 48, 0.15);
|
||||
|
||||
@if $o-webclient-color-scheme == dark {
|
||||
$_wf-bg-muted-hex: #2d2d2f !global;
|
||||
}
|
||||
|
||||
.o_fp_wf_chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
padding: 0.25rem 0.65rem;
|
||||
border-radius: 999px;
|
||||
font-size: 0.78rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.o_fp_wf_dot {
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
border-radius: 50%;
|
||||
background: currentColor;
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.o_fp_wf_next {
|
||||
font-weight: 400;
|
||||
opacity: 0.75;
|
||||
margin-left: 0.15rem;
|
||||
}
|
||||
|
||||
.o_fp_wf_chip_muted { background: $_wf-bg-muted-hex; color: #666; }
|
||||
.o_fp_wf_chip_info { background: $_wf-bg-info-hex; color: #0050a0; }
|
||||
.o_fp_wf_chip_success { background: $_wf-bg-success-hex; color: #1d6e2f; }
|
||||
.o_fp_wf_chip_warning { background: $_wf-bg-warning-hex; color: #b06600; }
|
||||
.o_fp_wf_chip_danger { background: $_wf-bg-danger-hex; color: #b00018; }
|
||||
|
||||
@if $o-webclient-color-scheme == dark {
|
||||
.o_fp_wf_chip_muted { color: #a8a8b0; }
|
||||
.o_fp_wf_chip_info { color: #6cb6ff; }
|
||||
.o_fp_wf_chip_success { color: #6be398; }
|
||||
.o_fp_wf_chip_warning { color: #ffb84d; }
|
||||
.o_fp_wf_chip_danger { color: #ff7a72; }
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-name="fusion_plating_shopfloor.WorkflowChip">
|
||||
<span t-att-class="'o_fp_wf_chip o_fp_wf_chip_' + toneClass">
|
||||
<span class="o_fp_wf_dot"/>
|
||||
<span class="o_fp_wf_label" t-esc="props.state.name"/>
|
||||
<t t-if="props.nextActionLabel">
|
||||
<span class="o_fp_wf_next">· next: <t t-esc="props.nextActionLabel"/></span>
|
||||
</t>
|
||||
</span>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
Reference in New Issue
Block a user