Files
Odoo-Modules/fusion_plating/fusion_plating_quality/scripts/step2_verify.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

38 lines
1.7 KiB
Python

# Step 2 verification - picking a part on the wizard line pre-fills coating + treatments.
W = env['fp.direct.order.wizard']
Line = env['fp.direct.order.line']
Part = env['fp.part.catalog']
Coating = env['fp.coating.config']
Treat = env['fp.treatment']
P = env['res.partner']
target = P.browse(2529)
# Pick a part that has a default coating + treatments configured.
part = Part.search([('x_fc_default_coating_config_id', '!=', False)], limit=1)
if not part:
# Build a synthetic one for the test.
coating = Coating.search([], limit=1)
treats = Treat.search([], limit=2)
part = Part.search([], limit=1)
part.x_fc_default_coating_config_id = coating.id
part.x_fc_default_treatment_ids = [(6, 0, treats.ids)]
print(f'Set up part {part.part_number}: default coating={coating.name}, treatments={treats.mapped("name")}')
print(f'Part: {part.part_number} rev {part.revision}')
print(f' default coating: {part.x_fc_default_coating_config_id.name if part.x_fc_default_coating_config_id else None}')
print(f' default treatments: {part.x_fc_default_treatment_ids.mapped("name") if part.x_fc_default_treatment_ids else None}')
# Build a wizard, add an empty line, simulate Sarah picking the part.
w = W.create({'partner_id': target.id})
w._onchange_partner_id()
ln = Line.new({'wizard_id': w.id})
ln.part_catalog_id = part
ln._onchange_part_clears_variant()
print()
print(f'After picking part on line:')
print(f' coating_config_id: {ln.coating_config_id.name if ln.coating_config_id else None}')
print(f' treatment_ids: {ln.treatment_ids.mapped("name") if ln.treatment_ids else None}')
print(f' Pre-fill worked? {bool(ln.coating_config_id) and bool(ln.treatment_ids)}')
env.cr.commit()