Files
Odoo-Modules/fusion_plating/fusion_plating_receiving/models/fp_outbound_package.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

45 lines
1.6 KiB
Python

# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# License OPL-1 (Odoo Proprietary License v1.0)
"""Per-package row for outbound multi-piece shipments.
Each fp.receiving has zero-or-more fp.outbound.package rows. When the
operator clicks Generate Outbound Label, one stock.package + one
carrier label is generated per row.
Single-box scenario: the form auto-fills one row when the receiving's
top-level weight/dim are set, so existing UX still works.
Multi-box scenario: operator adds more rows. Each row gets its own
tracking number + label PDF/ZPL stored back on the row after the API
call returns.
"""
from odoo import fields, models
class FpOutboundPackage(models.Model):
_name = 'fp.outbound.package'
_description = 'Fusion Plating - Outbound Package (per-box detail)'
_order = 'sequence, id'
receiving_id = fields.Many2one(
'fp.receiving', required=True, ondelete='cascade', index=True,
)
sequence = fields.Integer(default=10)
weight = fields.Float(string='Weight', digits=(10, 3))
length = fields.Float(string='Length', digits=(10, 2))
width = fields.Float(string='Width', digits=(10, 2))
height = fields.Float(string='Height', digits=(10, 2))
# Populated by the carrier API once Generate Label fires.
tracking_number = fields.Char(readonly=True, copy=False)
label_attachment_id = fields.Many2one(
'ir.attachment',
string='Label',
ondelete='set null',
readonly=True,
copy=False,
)
# Computed convenience: filename of the label (for download UX).
label_filename = fields.Char(
related='label_attachment_id.name', readonly=True,
)