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:
gsinghpal
2026-05-29 19:57:16 -04:00
parent da7ec59474
commit 855b160752
3 changed files with 34 additions and 6 deletions

View File

@@ -72,3 +72,13 @@ class TestPartDescriptionHistory(TransactionCase):
[('part_catalog_id', '=', self.part.id)])
self.assertEqual(len(versions), 2)
self.assertEqual(self.part.default_specification_text, 'c2')
# ----- Task 5: SO line auto-load -----
def test_so_line_onchange_loads_latest_version(self):
self.part._fp_save_description_version('shop notes', 'cust spec')
line = self.env['sale.order.line'].new({
'x_fc_part_catalog_id': self.part.id,
})
line._fp_onchange_part_load_description()
self.assertEqual(line.name, 'cust spec')
self.assertEqual(line.x_fc_internal_description, 'shop notes')