From b52fe01d0746e3a0f2405447ed218b0766d8e845 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Fri, 22 May 2026 21:45:33 -0400 Subject: [PATCH] feat(fusion_plating_shopfloor): WorkflowChip shared OWL service + dark-mode SCSS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../fusion_plating_shopfloor/__manifest__.py | 8 ++- .../static/src/js/components/workflow_chip.js | 39 +++++++++++++ .../src/scss/components/_workflow_chip.scss | 57 +++++++++++++++++++ .../src/xml/components/workflow_chip.xml | 14 +++++ .../tests/__init__.py | 1 + 5 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 fusion_plating/fusion_plating_shopfloor/static/src/js/components/workflow_chip.js create mode 100644 fusion_plating/fusion_plating_shopfloor/static/src/scss/components/_workflow_chip.scss create mode 100644 fusion_plating/fusion_plating_shopfloor/static/src/xml/components/workflow_chip.xml create mode 100644 fusion_plating/fusion_plating_shopfloor/tests/__init__.py diff --git a/fusion_plating/fusion_plating_shopfloor/__manifest__.py b/fusion_plating/fusion_plating_shopfloor/__manifest__.py index 53eee7e5..1f6f98dc 100644 --- a/fusion_plating/fusion_plating_shopfloor/__manifest__.py +++ b/fusion_plating/fusion_plating_shopfloor/__manifest__.py @@ -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', diff --git a/fusion_plating/fusion_plating_shopfloor/static/src/js/components/workflow_chip.js b/fusion_plating/fusion_plating_shopfloor/static/src/js/components/workflow_chip.js new file mode 100644 index 00000000..adbd2258 --- /dev/null +++ b/fusion_plating/fusion_plating_shopfloor/static/src/js/components/workflow_chip.js @@ -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"; + } +} diff --git a/fusion_plating/fusion_plating_shopfloor/static/src/scss/components/_workflow_chip.scss b/fusion_plating/fusion_plating_shopfloor/static/src/scss/components/_workflow_chip.scss new file mode 100644 index 00000000..2260a9a7 --- /dev/null +++ b/fusion_plating/fusion_plating_shopfloor/static/src/scss/components/_workflow_chip.scss @@ -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; } +} diff --git a/fusion_plating/fusion_plating_shopfloor/static/src/xml/components/workflow_chip.xml b/fusion_plating/fusion_plating_shopfloor/static/src/xml/components/workflow_chip.xml new file mode 100644 index 00000000..dd05aeee --- /dev/null +++ b/fusion_plating/fusion_plating_shopfloor/static/src/xml/components/workflow_chip.xml @@ -0,0 +1,14 @@ + + + + + + + + + · next: + + + + + diff --git a/fusion_plating/fusion_plating_shopfloor/tests/__init__.py b/fusion_plating/fusion_plating_shopfloor/tests/__init__.py new file mode 100644 index 00000000..40a96afc --- /dev/null +++ b/fusion_plating/fusion_plating_shopfloor/tests/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*-