Files
Odoo-Modules/fusion_plating/fusion_plating_invoicing/migrations/19.0.3.3.0/post-migrate.py
gsinghpal 8c76a16366 chore(plating): de-dash shipped code + intake-neutral customer emails
Replace em-dashes and en-dashes with hyphens across 789 shipped source
files (py/xml/js/scss) so the delivered module reads as human-written;
em-dashes had become a recognizable AI-generated tell. Internal .md dev
notes are excluded. The WO-sticker mojibake strippers keep their dash
search targets (now written — / –). No logic changes: comments
and display strings only; validated with py_compile + lxml parse.

Rewrite the 7 customer notification emails to be intake-neutral
(ship-in / drop-off / pickup) and repair-aware, and fix the Shipped
email documents line (packing slip vs bill of lading; certificate only
when issued). Subjects use a hyphen separator.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 00:16:19 -04:00

42 lines
1.5 KiB
Python

# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# License OPL-1 (Odoo Proprietary License v1.0)
"""Backfill plating defaults from fp.invoice.strategy.default → res.partner.
v3.3 merges the per-customer invoice strategy onto the partner record
itself so the new "Plating Defaults" tab is the single source of truth.
Only plain columns are migrated here (invoice_strategy + deposit %).
The legacy `fp.invoice.strategy.default` model is left in place; the
new sale.order onchange falls back to it for any partner whose record
hasn't been migrated, so downstream code keeps working mid-rollout.
property_payment_term_id is intentionally skipped - it lives in
ir_property rather than as a plain column, and the legacy onchange
fallback already reads payment_term from the strategy default record
when the partner doesn't have one set directly.
"""
import logging
_logger = logging.getLogger(__name__)
def migrate(cr, version):
if not version:
return
cr.execute("""
UPDATE res_partner p
SET x_fc_default_invoice_strategy = COALESCE(
p.x_fc_default_invoice_strategy, isd.default_strategy),
x_fc_default_deposit_percent = COALESCE(
NULLIF(p.x_fc_default_deposit_percent, 0),
isd.default_deposit_percent)
FROM fp_invoice_strategy_default isd
WHERE isd.partner_id = p.id
""")
_logger.info(
'fusion_plating_invoicing migration 19.0.3.3.0: backfilled %d '
'partner records from fp.invoice.strategy.default',
cr.rowcount,
)