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

@@ -88,7 +88,14 @@
<!-- ROW 2 — PO block (span 2) + Job# + Job Sorting -->
<div class="o_fp_xpr_cell span-2 o_fp_xpr_po_block">
<div class="o_fp_xpr_po_head">CUSTOMER PO</div>
<div class="o_fp_xpr_po_head">
<span>CUSTOMER PO</span>
<field name="po_status" widget="badge"
decoration-success="po_status == 'received'"
decoration-warning="po_status == 'pending'"
decoration-danger="po_status == 'missing'"
nolabel="1"/>
</div>
<div class="o_fp_xpr_po_row">
<label for="po_number">PO #</label>
<field name="po_number" nolabel="1"
@@ -179,6 +186,15 @@
ORDER LINES — spreadsheet
========================================================= -->
<div class="o_fp_xpr_section_title">Order Lines</div>
<!-- Legend bar — like the mockup -->
<div class="o_fp_xpr_legend">
<span><strong>Mask ✓</strong> include all masking + de-masking recipe steps</span>
<span><strong>Bake pill</strong> click to type bake instruction (empty = skip bake)</span>
<span><strong>DWG</strong> upload drawing to part</span>
<span><strong>OPEN</strong> open the part record</span>
</div>
<div class="mb-2 d-flex gap-2">
<button name="action_add_from_prior_so"
type="object"
@@ -196,32 +212,41 @@
decoration-warning="is_missing_info">
<field name="is_missing_info" column_invisible="1"/>
<field name="sequence" widget="handle"/>
<!-- The multi-row Part cell. Owns part_catalog_id picker
PLUS displays part_revision_display, part_name_display,
serial_ids + the inline + bulk button. -->
<field name="part_catalog_id"
string="Part Number"
widget="fp_express_part_cell"
context="{'default_partner_id': parent.partner_id, 'default_revision': 'A'}"
domain="[('partner_id', '=', parent.partner_id), ('is_latest_revision', '=', True)]"
options="{'no_quick_create': True}"/>
<field name="line_description" string="Specification"/>
<field name="customer_line_ref" string="Line Job #" placeholder="ABC"/>
<field name="thickness_range" string="Thickness" placeholder=".0005-.0010"/>
<field name="masking_enabled" string="Mask" widget="boolean_toggle"/>
<field name="bake_instructions" string="Bake" placeholder="no bake"/>
<field name="internal_description" string="Internal Notes" optional="show"/>
<!-- Hidden related fields the widget reads. Must be on the
list so they're prefetched per row. -->
<field name="part_number_display" column_invisible="1"/>
<field name="part_revision_display" column_invisible="1"/>
<field name="part_name_display" column_invisible="1"/>
<field name="serial_ids"
widget="many2many_tags"
options="{'no_quick_create': False, 'color_field': 'state_color'}"
domain="[('part_id', '=', part_catalog_id)]"
optional="show"/>
<button name="action_open_serial_bulk_add" type="object"
string="+ bulk"
class="btn-link btn-sm o_fp_xpr_inline_btn"
title="Bulk-add serial numbers"
invisible="not part_catalog_id"/>
<field name="quantity"/>
column_invisible="1"/>
<field name="line_description" string="Specification (Customer-Facing)"/>
<field name="customer_line_ref" string="Line Job #" placeholder="ABC"/>
<field name="thickness_range" string="Thickness" placeholder=".0005-.0010"/>
<field name="masking_enabled" string="Mask" widget="boolean_toggle"/>
<!-- Bake pill — click to edit -->
<field name="bake_instructions"
string="Bake"
widget="fp_express_bake_pill"/>
<field name="internal_description" string="Internal Notes" optional="show"/>
<field name="quantity" string="Qty"/>
<field name="unit_price"
string="Price"
widget="monetary"
options="{'currency_field': 'currency_id'}"/>
<field name="line_subtotal"
string="Subtotal"
widget="monetary"
options="{'currency_field': 'currency_id'}"
sum="Total"/>
@@ -268,7 +293,20 @@
<div class="o_fp_xpr_footer_right">
<div class="o_fp_xpr_card o_fp_xpr_totals">
<div class="o_fp_xpr_card_title">Totals</div>
<div class="o_fp_xpr_total_row">
<span class="o_fp_xpr_total_label">Subtotal</span>
<field name="total_amount"
widget="monetary"
options="{'currency_field': 'currency_id'}"
readonly="1" nolabel="1"/>
</div>
<div class="o_fp_xpr_total_row">
<span class="o_fp_xpr_total_label">Tooling Charge</span>
<field name="tooling_charge"
widget="monetary"
options="{'currency_field': 'currency_id'}"
nolabel="1"/>
</div>
<div class="o_fp_xpr_total_row">
<span class="o_fp_xpr_total_label">Total Lines</span>
<field name="total_line_count" readonly="1" nolabel="1"/>