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>
This commit is contained in:
@@ -24,7 +24,7 @@ class TestDashboardSnapshotShape(TransactionCase):
|
||||
def test_section_order_is_canonical(self):
|
||||
snap = self._build()
|
||||
types_present = [s['type'] for s in snap['sections']]
|
||||
# Canonical order — cert, hold, ncr, rma, capa, check.
|
||||
# Canonical order - cert, hold, ncr, rma, capa, check.
|
||||
# Some types may be absent if their model isn't installed; the
|
||||
# PRESENT ones must appear in this relative order.
|
||||
canonical = ['cert', 'hold', 'ncr', 'rma', 'capa', 'check']
|
||||
@@ -55,7 +55,7 @@ class TestDashboardSnapshotShape(TransactionCase):
|
||||
|
||||
|
||||
class TestDashboardSnapshotItems(TransactionCase):
|
||||
"""Per-section items list — ranking + cap + shape."""
|
||||
"""Per-section items list - ranking + cap + shape."""
|
||||
|
||||
def _build(self):
|
||||
from odoo.addons.fusion_plating_quality.controllers.fp_quality_dashboard \
|
||||
@@ -167,7 +167,7 @@ class TestDashboardSnapshotBanner(TransactionCase):
|
||||
|
||||
def test_banner_all_clear_when_zero(self):
|
||||
snap = self._build()
|
||||
# Empty DB — no overdue, no critical
|
||||
# Empty DB - no overdue, no critical
|
||||
self.assertTrue(snap['banner']['all_clear'])
|
||||
self.assertEqual(snap['banner']['items'], [])
|
||||
|
||||
@@ -182,7 +182,7 @@ class TestDashboardSnapshotDefensive(TransactionCase):
|
||||
|
||||
def test_missing_partner_field_falls_through(self):
|
||||
# Empty DB + helper must not raise even when x_fc_rush absent.
|
||||
# (In this codebase x_fc_rush isn't a registered field — only
|
||||
# (In this codebase x_fc_rush isn't a registered field - only
|
||||
# read defensively via the `in partner._fields` check. The
|
||||
# snapshot must build cleanly.)
|
||||
snap = self._build()
|
||||
|
||||
@@ -24,14 +24,14 @@ class TestContractReviewEnforcementOnCreate(TransactionCase):
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
# Customer A — enforcement ON
|
||||
# Customer A - enforcement ON
|
||||
self.cust_enforced = self.env['res.partner'].create({
|
||||
'name': 'Enforced Customer',
|
||||
'is_company': True,
|
||||
'customer_rank': 1,
|
||||
'x_fc_contract_review_required': True,
|
||||
})
|
||||
# Customer B — enforcement OFF (control)
|
||||
# Customer B - enforcement OFF (control)
|
||||
self.cust_unenforced = self.env['res.partner'].create({
|
||||
'name': 'Unenforced Customer',
|
||||
'is_company': True,
|
||||
@@ -73,7 +73,7 @@ class TestContractReviewEnforcementOnCreate(TransactionCase):
|
||||
)
|
||||
|
||||
def test_existing_review_is_not_replaced(self):
|
||||
# Pre-create a review and pass it in vals — create() must not
|
||||
# Pre-create a review and pass it in vals - create() must not
|
||||
# overwrite it (idempotency on copy/import flows).
|
||||
existing_part = self.env['fp.part.catalog'].create({
|
||||
'partner_id': self.cust_enforced.id,
|
||||
@@ -97,7 +97,7 @@ class TestContractReviewEnforcementOnCreate(TransactionCase):
|
||||
)
|
||||
|
||||
def test_batch_create_each_part_gets_own_review(self):
|
||||
# Batch create — each enforced part gets its own review.
|
||||
# Batch create - each enforced part gets its own review.
|
||||
parts = self.env['fp.part.catalog'].create([
|
||||
{'partner_id': self.cust_enforced.id,
|
||||
'part_number': 'BATCH-001', 'revision': 'A'},
|
||||
@@ -169,7 +169,7 @@ class TestContractReviewEnforcementOnCreate(TransactionCase):
|
||||
mock_send.called,
|
||||
'bus.bus._sendone must be called on enforced create.',
|
||||
)
|
||||
# Inspect the call payload — type=warning + sticky=True.
|
||||
# Inspect the call payload - type=warning + sticky=True.
|
||||
# Args: (self, target, type, payload)
|
||||
call_args = mock_send.call_args
|
||||
payload = call_args.args[3] if len(call_args.args) >= 4 else call_args.kwargs.get('notification')
|
||||
@@ -194,7 +194,7 @@ class TestContractReviewEnforcementOnCreate(TransactionCase):
|
||||
# -- Write must NOT re-trigger ----------------------------------
|
||||
|
||||
def test_write_does_not_retrigger_alert(self):
|
||||
# Pre-existing part under unenforced customer — no review yet.
|
||||
# Pre-existing part under unenforced customer - no review yet.
|
||||
part = self.env['fp.part.catalog'].create({
|
||||
'partner_id': self.cust_unenforced.id,
|
||||
'part_number': 'WRITE-001',
|
||||
@@ -203,7 +203,7 @@ class TestContractReviewEnforcementOnCreate(TransactionCase):
|
||||
self.assertFalse(part.x_fc_contract_review_id)
|
||||
|
||||
# Now flip the customer's flag and update the part. The create
|
||||
# gate is .create()-only by design — write/update must NOT
|
||||
# gate is .create()-only by design - write/update must NOT
|
||||
# auto-create a review or push a notification.
|
||||
self.cust_unenforced.x_fc_contract_review_required = True
|
||||
with patch.object(
|
||||
@@ -212,7 +212,7 @@ class TestContractReviewEnforcementOnCreate(TransactionCase):
|
||||
part.write({'revision_note': 'updated after enforcement enabled'})
|
||||
self.assertFalse(
|
||||
mock_send.called,
|
||||
'write() must NOT push a contract-review notification — '
|
||||
'write() must NOT push a contract-review notification - '
|
||||
'enforcement only applies on first creation.',
|
||||
)
|
||||
self.assertFalse(
|
||||
|
||||
Reference in New Issue
Block a user