feat(configurator): replace inline previews with smart button + Preview links

The Quote Configurator form devoted nearly half its width to a sticky
3D viewer + drawing PDF preview. That panel meant the actual fields
(geometry, dimensions, pricing) had to fight for real estate. Replaced
the inline previews with two affordances that take zero layout space:

  1. New '3D Model' smart button at the top of the form, next to the
     existing 'Drawings' button. Click to open the existing
     fp_3d_viewer_open client action — same fullscreen modal the
     'Full Screen' button used to launch from the side panel.

  2. Inline 'Preview' link (eye icon) sits next to the 3D Model and
     Drawing fields in the Customer & Part group. Click to open the
     same modal preview as the smart button. Two paths to the same
     content — power users grab the field-adjacent link mid-edit;
     visual-thinkers grab the smart button up top.

Layout collapses to a single full-width column. The .o_fp_cfg_layout
wrapper is kept (display:block) so we have a stable hook in case a
side panel returns later for a different purpose. Old SCSS dance with
:has() selectors to fake-collapse the grid is gone.

Bumped fusion_plating_configurator to 19.0.3.0.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-19 00:13:28 -04:00
parent 4065c6891b
commit f3e01a342b
3 changed files with 61 additions and 85 deletions

View File

@@ -5,7 +5,7 @@
{
'name': 'Fusion Plating — Configurator',
'version': '19.0.2.0.0',
'version': '19.0.3.0.0',
'category': 'Manufacturing/Plating',
'summary': 'Quotation configurator with part catalog, coating configs, and formula-based pricing engine.',
'description': """

View File

@@ -4,54 +4,18 @@
// License OPL-1 (Odoo Proprietary License v1.0)
// =============================================================================
// -- Configurator two-column layout: 3/4 fields + 1/4 preview --
// When the preview column is hidden (no 3D model AND no drawings), the
// fields column expands to full width via the :has() selector below.
// -- Configurator layout (single column) -------------------------------------
// The right-side 3D viewer + drawing preview were retired in favour of
// smart-button + inline-Preview-link affordances. Layout collapses to a
// single full-width column. Wrapper kept so the SCSS hook stays stable
// in case we add a side panel back later.
.o_fp_cfg_layout {
display: grid;
grid-template-columns: 1fr 380px;
gap: 16px;
align-items: start;
display: block;
}
// Full width when right column has no visible content
.o_fp_cfg_layout:has(> .o_fp_cfg_preview.o_invisible_modifier),
.o_fp_cfg_layout:has(> .o_fp_cfg_preview[style*="display: none"]),
.o_fp_cfg_layout:has(> .o_fp_cfg_preview[style*="display:none"]) {
grid-template-columns: 1fr;
}
.o_fp_cfg_fields {
min-width: 0;
}
.o_fp_cfg_preview {
position: sticky;
top: 16px;
// Force all field widgets (3D viewer, Html drawing preview) to be
// block-level + full width so the 3D and PDF iframes match exactly.
.o_field_widget,
> div > .o_field_widget {
display: block;
width: 100%;
}
iframe {
display: block;
}
}
// Responsive: stack on narrow screens
@media (max-width: 1200px) {
.o_fp_cfg_layout {
grid-template-columns: 1fr;
}
.o_fp_cfg_preview {
position: static;
}
}
// -- 3D viewer widget --
.o_fp_3d_viewer_root {
width: 100%;

View File

@@ -66,6 +66,22 @@
invisible="not part_catalog_id">
<field name="part_catalog_id" widget="statinfo" string="Part"/>
</button>
<!--
3D Model + Drawings smart buttons.
Both open a modal preview (action_open_3d_fullscreen
and action_view_drawings) that replaces what used
to be the right-column inline previews.
-->
<button name="action_open_3d_fullscreen"
type="object"
class="oe_stat_button"
icon="fa-cube"
invisible="not model_attachment_id">
<div class="o_stat_info">
<span class="o_stat_value">1</span>
<span class="o_stat_text">3D Model</span>
</div>
</button>
<button name="action_view_drawings"
type="object"
class="oe_stat_button"
@@ -100,9 +116,14 @@
</h1>
</div>
<!-- Main layout: 3/4 fields (left) + 1/4 3D preview (right) -->
<!--
Single-column layout. The right-side 3D viewer +
Drawing preview were removed (commit pending) — both
live behind the 3D Model / Drawings smart buttons at
the top of the form, plus inline "Preview" links
next to each respective field.
-->
<div class="o_fp_cfg_layout">
<!-- LEFT COLUMN: all fields -->
<div class="o_fp_cfg_fields">
<group>
<group string="Customer &amp; Part">
@@ -114,19 +135,41 @@
invisible="state != 'draft' or model_attachment_id"
string="Attach 3D File"/>
<field name="upload_3d_filename" invisible="1"/>
<field name="model_attachment_id"
string="3D Model"
invisible="not model_attachment_id"
readonly="state != 'draft'"/>
<!-- Drawing: upload before, filename + clear button after -->
<!--
3D Model + inline Preview link. Field shows
the attachment name, the small Preview link
opens the same fullscreen wizard as the
smart button at the top of the form.
-->
<label for="model_attachment_id" string="3D Model"
invisible="not model_attachment_id"/>
<div class="o_row" invisible="not model_attachment_id">
<field name="model_attachment_id" nolabel="1"
readonly="state != 'draft'"/>
<button name="action_open_3d_fullscreen"
type="object"
string="Preview"
icon="fa-eye"
class="btn btn-link btn-sm ms-2 p-0"
title="Open 3D model preview"/>
</div>
<!-- Drawing: upload before, filename + Preview link after -->
<field name="upload_drawing" filename="upload_drawing_filename"
invisible="state != 'draft' or drawing_count > 0"
string="Attach Drawing"/>
<field name="upload_drawing_filename" invisible="1"/>
<field name="first_drawing_id"
string="Drawing"
invisible="drawing_count == 0"
readonly="state != 'draft'"/>
<label for="first_drawing_id" string="Drawing"
invisible="drawing_count == 0"/>
<div class="o_row" invisible="drawing_count == 0">
<field name="first_drawing_id" nolabel="1"
readonly="state != 'draft'"/>
<button name="action_view_drawings"
type="object"
string="Preview"
icon="fa-eye"
class="btn btn-link btn-sm ms-2 p-0"
title="Open drawing preview"/>
</div>
<field name="drawing_count" invisible="1"/>
</group>
<group string="RFQ / PO Documents">
@@ -222,37 +265,6 @@
</group>
</div>
<!-- RIGHT COLUMN: 3D preview + Drawings preview (sticky) -->
<div class="o_fp_cfg_preview"
invisible="not model_attachment_id and drawing_count == 0">
<!-- 3D viewer -->
<div invisible="not model_attachment_id">
<field name="model_attachment_id" widget="fp_3d_preview" nolabel="1"/>
<div class="text-center mt-2">
<button name="action_open_3d_fullscreen"
string="Full Screen"
type="object"
class="btn btn-sm btn-outline-primary"
icon="fa-expand"/>
</div>
</div>
<!-- Drawings preview (custom OWL widget — fixed height, full screen button) -->
<div invisible="drawing_count == 0" class="mt-3">
<span class="o_form_label fw-bold text-muted small d-block mb-1">Drawing Preview</span>
<field name="first_drawing_id"
widget="fp_pdf_inline_preview"
nolabel="1"
readonly="1"/>
<!-- Multi-drawing list shown only when more than one -->
<div invisible="drawing_count &lt; 2" class="mt-2">
<span class="o_form_label fw-bold text-muted small d-block mb-1">All Drawings</span>
<field name="drawing_attachment_ids"
widget="fp_pdf_preview_binary"
nolabel="1"
readonly="1"/>
</div>
</div>
</div>
</div>
<notebook>