feat(configurator): save a part description version on SO confirm

Each part-bearing line writes a deduped version (final order# + date) via
_fp_save_description_version, after the parent-number rename so the title
reflects the confirmed order number.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-29 19:56:01 -04:00
parent 2ed3dcee58
commit da7ec59474

View File

@@ -886,4 +886,19 @@ class SaleOrder(models.Model):
line.x_fc_job_number = Sequence.next_by_code(
'fp.job.number'
) or False
# Per-part description history (spec 2026-05-29). After super() +
# the parent-number rename, so.name is the final order number.
for so in self:
for line in so.order_line:
if line.display_type:
continue
part = (line.x_fc_part_catalog_id
if 'x_fc_part_catalog_id' in line._fields else False)
if not part:
continue
part._fp_save_description_version(
internal_desc=line.x_fc_internal_description or '',
customer_desc=line.name or '',
order=so, line=line,
)
return res