Files
Odoo-Modules/fusion_plating/fusion_plating_notifications/models/fp_delivery.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

34 lines
1.2 KiB
Python

# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# License OPL-1 (Odoo Proprietary License v1.0)
# Part of the Fusion Plating product family.
from odoo import models
class FpDelivery(models.Model):
_inherit = 'fusion.plating.delivery'
def action_mark_delivered(self):
res = super().action_mark_delivered()
Dispatch = self.env['fp.notification.template']
Job = self.env.get('fp.job')
for rec in self:
if not rec.partner_id:
continue
so = False
# Native: fp.job direct link.
if Job is not None and 'x_fc_job_id' in rec._fields and rec.x_fc_job_id:
so = rec.x_fc_job_id.sale_order_id or False
elif Job is not None and rec.job_ref:
job = Job.search([('name', '=', rec.job_ref)], limit=1)
if job:
so = job.sale_order_id or False
# Sub 6 - pass the delivery address so location-scoped
# contacts receive the 'shipped' notification.
Dispatch._dispatch(
'shipped', rec, rec.partner_id, sale_order=so,
delivery_location=rec.delivery_address_id or False,
)
return res