feat(configurator): auto-load latest part description version on order entry
Wizard line (direct + express) and SO line now pre-fill BOTH internal + customer-facing from the part's latest version (fallback to default_specification_text), without clobbering typed text. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -629,12 +629,16 @@ class FpDirectOrderLine(models.Model):
|
||||
if bake_default:
|
||||
rec.bake_instructions = bake_default
|
||||
|
||||
# ---- Express line_description (Specification) ----
|
||||
# Only seed if currently empty (don't clobber operator-typed text).
|
||||
if not rec.line_description:
|
||||
spec_default = getattr(part, 'default_specification_text', None)
|
||||
if spec_default:
|
||||
rec.line_description = spec_default
|
||||
# ---- Description history auto-load (spec 2026-05-29) ----
|
||||
# Latest per-part version wins; _fp_resolve_line_descriptions
|
||||
# falls back to default_specification_text (customer-facing only)
|
||||
# for parts with no version yet. Loads BOTH fields; never
|
||||
# clobbers text the operator already typed.
|
||||
descs = part._fp_resolve_line_descriptions()
|
||||
if not rec.line_description and descs['customer_facing']:
|
||||
rec.line_description = descs['customer_facing']
|
||||
if not rec.internal_description and descs['internal']:
|
||||
rec.internal_description = descs['internal']
|
||||
|
||||
# ---- Express masking_enabled (always re-seed from part default) ----
|
||||
# Boolean has no "empty" state; explicit reseed on every part-change
|
||||
|
||||
Reference in New Issue
Block a user