feat(configurator): Part cell rows 2-3 now editable — type to save
Customer feedback: rows 2 (description) and 3 (serials) in the Part cell rendered as read-only spans. User wanted to edit directly. New writable computed fields on fp.direct.order.line: - part_name_editable: compute reads part_catalog_id.name, inverse writes back to part.name on the linked catalog record - serials_text: compute joins serial_ids names with commas; inverse parses the typed string and find-or-creates fp.serial records, updates the line's serial_ids M2M Removed the redundant rev separator (display_name already includes '(Rev X)' so showing it twice was clutter). Rev edits happen by editing the part record directly via the OPEN button. OWL widget templates updated: - Row 2: <input> bound to part_name_editable, t-on-change saves - Row 3: <input> bound to serials_text, t-on-change parses + saves SCSS: - Row 2 input: italic, transparent border, focus tints background yellow - Row 3 input: small grey text, comma-separated friendly placeholder - Both disabled-look when no part is picked Both inputs trigger the inverse method on blur. The G4 sync chain takes over from there to push line.line_description etc. back to the part as before — so editing in the line keeps the part defaults fresh for future orders.
This commit is contained in:
@@ -1,27 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<!-- Express Orders — Part cell template (3-row stacked) -->
|
||||
<!-- Express Orders — Part cell template (3 stacked rows)
|
||||
|
||||
Row 1: Part picker (Many2OneField — display_name is just the
|
||||
part_number when fp_express_part_picker context is set)
|
||||
Row 2: editable part description (writes to part.name on blur)
|
||||
Row 3: editable serial #s (parses comma-separated, creates fp.serial
|
||||
records as needed) + small + bulk button
|
||||
-->
|
||||
<t t-name="fusion_plating_configurator.FpExpressPartCell">
|
||||
<div class="o_fp_xpr_part_cell">
|
||||
<!-- Row 1: Part Number picker + Revision -->
|
||||
<!-- Row 1 — Part picker -->
|
||||
<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 —'"/>
|
||||
<!-- Row 2 — Editable part description (saves to part.name) -->
|
||||
<div class="o_fp_xpr_part_row o_fp_xpr_part_name">
|
||||
<input class="o_fp_xpr_part_name_input"
|
||||
type="text"
|
||||
t-att-value="partName"
|
||||
t-att-disabled="!hasPart"
|
||||
t-on-change="onNameChange"
|
||||
placeholder="— part description —"
|
||||
title="Edit the part's name — saves to the part record"/>
|
||||
</div>
|
||||
<!-- Row 3: Serial #(s) + bulk button -->
|
||||
<!-- Row 3 — Editable serial list + bulk-add 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'"/>
|
||||
<input class="o_fp_xpr_serial_input"
|
||||
type="text"
|
||||
t-att-value="serialsText"
|
||||
t-att-disabled="!hasPart"
|
||||
t-on-change="onSerialsChange"
|
||||
placeholder="serial #(s) — comma separated"
|
||||
title="Type serials separated by commas — creates fp.serial records as needed"/>
|
||||
<button class="o_fp_xpr_bulk_btn"
|
||||
t-on-click="onBulkClick"
|
||||
t-att-disabled="!hasPart"
|
||||
|
||||
Reference in New Issue
Block a user