feat(configurator): drop legacy description column after dual-field migration (Sub 2 Task 27)
Removes the `description` field from `fp.sale.description.template` now that all readers (reports, wizard, sale line) consume the new `internal_description` + `customer_facing_description` pair. - Model: drop `description = fields.Text(...)` declaration - Migration 19.0.9.0.0 Step 6: `ALTER TABLE ... DROP COLUMN IF EXISTS description` - Template form/search views: swap `description` for the two new fields - Seed data: write new fields instead of legacy column (dupes old text into both) - Direct-order wizard: remove `tpl.description` fallback in both onchange handlers Entech column dropped via Odoo's auto-schema-sync during module upgrade (migration step is for fresh installs). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -206,15 +206,12 @@ class FpDirectOrderLine(models.TransientModel):
|
||||
Customer-facing text lands in `line_description` (ends up on the
|
||||
SO line `name`, prints on customer docs). Internal text lands in
|
||||
`internal_description` (ends up in x_fc_internal_description on
|
||||
the SO line, prints on WO / traveler only). Falls back to the
|
||||
legacy `description` field when the new dual fields are empty so
|
||||
pre-Sub-2 templates keep working.
|
||||
the SO line, prints on WO / traveler only).
|
||||
"""
|
||||
if self.description_template_id:
|
||||
tpl = self.description_template_id
|
||||
customer_text = tpl.customer_facing_description or tpl.description
|
||||
if customer_text:
|
||||
self.line_description = customer_text
|
||||
if tpl.customer_facing_description:
|
||||
self.line_description = tpl.customer_facing_description
|
||||
if tpl.internal_description:
|
||||
self.internal_description = tpl.internal_description
|
||||
|
||||
@@ -235,9 +232,8 @@ class FpDirectOrderLine(models.TransientModel):
|
||||
|
||||
def _apply(match):
|
||||
self.description_template_id = match.id
|
||||
customer_text = match.customer_facing_description or match.description
|
||||
if customer_text:
|
||||
self.line_description = customer_text
|
||||
if match.customer_facing_description:
|
||||
self.line_description = match.customer_facing_description
|
||||
if match.internal_description:
|
||||
self.internal_description = match.internal_description
|
||||
|
||||
|
||||
Reference in New Issue
Block a user