feat(configurator): OWL widgets + Express form polish to match mockup

NEW OWL widgets:
- FpExpressPartCell (static/src/js/express_part_cell.js + .xml) — multi-row
  Part cell. Wraps Many2OneField for the part picker (row 1: part# / rev,
  bold). Below it: row 2 part description (italic muted), row 3 serial #s
  joined + '+ bulk' button that triggers the existing bulk-add wizard.
- FpExpressBakePill (static/src/js/express_bake_pill.js + .xml) — click-
  to-edit Bake pill. Renders amber pill when set, italic muted 'no bake'
  when empty. Click swaps to inline textarea + Save / Clear / Cancel.

NEW fields:
- fp.direct.order.line.part_number_display / part_revision_display /
  part_name_display (related Char from fp.part.catalog) — fed to the
  Part cell widget so it can render multi-row without RPC.
- fp.direct.order.wizard.tooling_charge (Monetary) — surfaced in the
  Totals card on the Express form.
- fp.direct.order.wizard.po_status (computed Selection
  received/pending/missing) — drives the PO Block status badge.
- sale.order.x_fc_tooling_charge (Monetary) — receives wizard.tooling_charge
  at confirm.

View updates (fp_express_order_views.xml):
- PO block header now shows the PO status pill (green Received,
  amber Pending, red Missing)
- Order Lines legend bar (Mask / Bake pill / DWG / OPEN explainers)
- Part Number column uses widget='fp_express_part_cell' — single cell
  with 3 internal rows
- Bake column uses widget='fp_express_bake_pill' — interactive pill
- Totals card now has Subtotal / Tooling Charge / Total Lines / Total
  Quantity / Grand Total + currency pill

SCSS adds:
- Multi-row part cell styles (internal borders, bold/italic/muted rows)
- Bake pill (has-bake amber, no-bake italic muted) + inline editor
- Legend bar (section background, gap-spaced explainer chips)
- PO status pill colour scheme
- Bulk button styling

Wizard's action_create_order now carries tooling_charge to the SO at
confirm so it persists on the resulting sale.order.
This commit is contained in:
gsinghpal
2026-05-26 22:13:54 -04:00
parent 1d674e587c
commit 0f2ed5cc16
10 changed files with 577 additions and 15 deletions

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<!-- Express Orders — Bake pill (click-to-edit) -->
<t t-name="fusion_plating_configurator.FpExpressBakePill">
<div class="o_fp_xpr_bake_wrap">
<t t-if="!state.editing">
<span class="o_fp_xpr_bake_pill"
t-att-class="{ 'has-bake': hasBake, 'no-bake': !hasBake }"
t-on-click="openEditor"
t-esc="pillLabel"
title="Click to edit"/>
</t>
<t t-else="">
<div class="o_fp_xpr_bake_editor" t-on-keydown="onKeyDown">
<textarea t-ref="textarea"
t-model="state.draft"
rows="2"
placeholder="e.g. 350°F × 4 hr"/>
<div class="o_fp_xpr_bake_actions">
<button class="btn btn-sm btn-primary" t-on-click="save">Save</button>
<button class="btn btn-sm btn-secondary" t-on-click="clear">Clear</button>
<button class="btn btn-sm btn-link" t-on-click="cancel">Cancel</button>
</div>
</div>
</t>
</div>
</t>
</templates>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<!-- Express Orders — Part cell template (3-row stacked) -->
<t t-name="fusion_plating_configurator.FpExpressPartCell">
<div class="o_fp_xpr_part_cell">
<!-- Row 1: Part Number picker + Revision -->
<div class="o_fp_xpr_part_row o_fp_xpr_part_id">
<Many2OneField t-props="props"/>
<span class="o_fp_xpr_part_sep">/</span>
<span class="o_fp_xpr_part_rev"
t-esc="partRev or ''"
t-att-class="{ 'o_fp_xpr_part_rev_empty': !partRev }"/>
</div>
<!-- Row 2: Part description / name (italic, muted) -->
<div class="o_fp_xpr_part_row o_fp_xpr_part_name"
t-att-class="{ 'o_fp_xpr_part_name_empty': !partName }">
<t t-esc="partName or '— no description —'"/>
</div>
<!-- Row 3: Serial #(s) + bulk button -->
<div class="o_fp_xpr_part_row o_fp_xpr_part_serial">
<span class="o_fp_xpr_serials"
t-att-class="{ 'o_fp_xpr_serials_empty': !serialsList.length }"
t-esc="serialsDisplay or 'no serials yet'"/>
<button class="o_fp_xpr_bulk_btn"
t-on-click="onBulkClick"
t-att-disabled="!hasPart"
title="Bulk add serials (paste list or range fill)">
+ bulk
</button>
</div>
</div>
</t>
</templates>