When Sub 2 Task 26 flipped x_fc_internal_description to required=True, any programmatic sale.order.line creation that doesn't set the field fails at the Postgres NOT NULL constraint. Callers include: - sale_mrp stock-move line creation (doesn't set name either) - demo seeders - external integrations - test scripts The UI-side onchange populates the field when the user picks a description template; this hook mirrors that for programmatic callers. Fallback chain: explicit vals['x_fc_internal_description'] → vals['name'] → product_id.display_name → '—'. Matches the migration's backfill rule. Also adds Sub 2 end-to-end smoke test (6 cases, all green): 1. Required-field rejection on part creation 2. Required-field rejection on template creation 3. Template picker populates both SO-line descriptions 4. Cert resolver: part-level override wins over partner 5. display_name renders part_number + revision + name 6. certificate_requirement defaults to 'inherit' QC Phase 1-3 regression suite remains green after the fix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5.5 KiB
5.5 KiB