fix(quick-look): dark-mode-aware instructions panel

The Operator Instructions panel had a hardcoded inline style
(background: #f8f9fa) which became a white-on-dark unreadable blob
in dark mode. Replaced with a CSS class backed by an SCSS file that
branches at compile-time via $o-webclient-color-scheme — registered
in both web.assets_backend (light) and web.assets_web_dark (dark)
bundles per the CLAUDE.md pattern.

Tokens: panel bg #f8f9fa light / #22262d dark; border #d8dadd /
#3a3f47; text #212529 / #e8eaed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-29 23:40:55 -04:00
parent 555dd5421f
commit f7fcd03bfc
5 changed files with 79 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
# License OPL-1 (Odoo Proprietary License v1.0)
{
'name': 'Fusion Plating — Native Jobs',
'version': '19.0.8.14.0',
'version': '19.0.8.14.2',
'category': 'Manufacturing/Plating',
'summary': 'Native plating job model — replaces mrp.production / mrp.workorder bridge.',
'author': 'Nexa Systems Inc.',
@@ -71,8 +71,16 @@ full design rationale and §6.2 of the implementation plan for task list.
'report/report_fp_job_margin.xml',
],
'assets': {
# No bundled JS/SCSS — the canonical operator UIs live in
# fusion_plating_shopfloor (consolidated 2026-04-24).
# Sub 12d — Step Details quick-look modal styles. Registered in
# both bundles so light + dark mode each compile correctly
# ($o-webclient-color-scheme branches at compile time per
# CLAUDE.md note).
'web.assets_backend': [
'fusion_plating_jobs/static/src/scss/fp_step_quick_look.scss',
],
'web.assets_web_dark': [
'fusion_plating_jobs/static/src/scss/fp_step_quick_look.scss',
],
},
'installable': True,
'application': False,

View File

@@ -933,3 +933,25 @@ class FpJobStep(models.Model):
'target': 'current',
'name': self.name,
}
def action_open_quick_look(self):
"""Open the read-only Step Details quick-look modal.
Bound to the row-button on the embedded step list — explicit
trigger needed because editable="bottom" intercepts row clicks
for inline editing rather than opening the form view.
"""
self.ensure_one()
view = self.env.ref(
'fusion_plating_jobs.view_fp_job_step_quick_look_form'
)
return {
'type': 'ir.actions.act_window',
'res_model': 'fp.job.step',
'res_id': self.id,
'view_mode': 'form',
'view_id': view.id,
'views': [(view.id, 'form')],
'target': 'new',
'name': self.name,
}

View File

@@ -0,0 +1,41 @@
// Step Details Quick-Look modal — dark-mode aware tokens.
// Pattern documented in fusion-plating/CLAUDE.md: branch hex values
// at SCSS compile-time via $o-webclient-color-scheme. Don't rely on
// var(--bs-body-bg) — Odoo 19 doesn't flip it consistently across
// addons.
$o-webclient-color-scheme: bright !default;
$_fp_ql_panel_hex: #f8f9fa;
$_fp_ql_border_hex: #d8dadd;
$_fp_ql_text_hex: #212529;
@if $o-webclient-color-scheme == dark {
$_fp_ql_panel_hex: #22262d !global;
$_fp_ql_border_hex: #3a3f47 !global;
$_fp_ql_text_hex: #e8eaed !global;
}
$fp-ql-panel: var(--fp-card-bg, #{$_fp_ql_panel_hex});
$fp-ql-border: var(--fp-border-color, #{$_fp_ql_border_hex});
$fp-ql-text: var(--fp-text, #{$_fp_ql_text_hex});
// Container around the rich-text instructions inside the quick-look
// modal. Bordered + scrollable + readable in both light and dark modes.
.o_fp_quick_look_instructions {
max-height: 40vh;
overflow: auto;
padding: 12px 14px;
margin-bottom: 8px;
background: $fp-ql-panel;
color: $fp-ql-text;
border: 1px solid $fp-ql-border;
border-radius: 4px;
// Make sure rich-text inner elements inherit the readable colour.
p, li, span, strong, em, h1, h2, h3, h4, h5, h6 {
color: inherit;
}
ul, ol { margin-bottom: 0; }
p:last-child { margin-bottom: 0; }
}

View File

@@ -83,6 +83,10 @@
decoration-warning="state == 'paused'"
decoration-muted="state in ('skipped', 'cancelled')">
<field name="sequence" widget="handle"/>
<button name="action_open_quick_look" type="object"
title="View step details"
icon="fa-info-circle"
class="btn-link"/>
<field name="name"/>
<field name="work_centre_id" optional="show"/>
<field name="tank_id" optional="hide"/>

View File

@@ -58,7 +58,7 @@
</div>
<separator string="Operator Instructions"/>
<div style="max-height: 40vh; overflow: auto; padding: 8px; background: #f8f9fa; border: 1px solid #d8dadd; border-radius: 4px;">
<div class="o_fp_quick_look_instructions">
<field name="quick_look_instructions" nolabel="1" readonly="1"/>
</div>
<p class="text-muted small"