feat(promote-customer-spec): Phase D — reports + tablet payload include spec

Reports updated to print Specification (with revision via display_name):
- report_fp_sale.xml — header sections show "SPECIFICATION" instead
  of "COATING CONFIG", reads doc.x_fc_customer_spec_id (added on
  sale.order via quality inherit, computed from line.customer_spec_id)
- report_fp_wo_sticker.xml — propagates _spec alongside _coating
- fusion_plating_reports/report_fp_job_traveller.xml — header row
  now shows Specification (falls back to coating)
- fusion_plating_jobs/report_fp_job_traveller.xml — same fall-back
- fusion_plating_jobs/report_fp_job_sticker.xml — _spec added

sale.order.x_fc_customer_spec_id added as a stored compute on
sale.order (in quality) so reports can render order-level spec.
Mirrors the line's first spec; updates on line edit.

Tablet payload (shopfloor_controller.py):
- spec_label added to the job payload dict
- defensive 'customer_spec_id' in job._fields check (shopfloor doesn't
  depend on quality — circular if added)

Portal: deferred (same circular-dep issue, more substantial UI rewrite
needed; Phase E backlog item).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-15 01:30:05 -04:00
parent c637f82ae2
commit e0eacc2530
11 changed files with 63 additions and 16 deletions

View File

@@ -5,7 +5,7 @@
{
'name': 'Fusion Plating — Quality (QMS)',
'version': '19.0.5.2.0',
'version': '19.0.5.3.0',
'category': 'Manufacturing/Plating',
'summary': 'Native QMS for plating shops: NCR, CAPA, calibration, AVL, FAIR, '
'internal audits, customer specs, document control. CE + EE compatible.',

View File

@@ -6,6 +6,29 @@
from odoo import api, fields, models
class SaleOrder(models.Model):
"""Add an order-level Specification mirror so reports can print it
in the header summary section. Computed from the lines (first
spec wins; falls back to blank when lines have no spec).
"""
_inherit = 'sale.order'
x_fc_customer_spec_id = fields.Many2one(
'fusion.plating.customer.spec',
string='Specification',
compute='_compute_x_fc_customer_spec_id',
store=True,
help='First specification cited on this order (or blank). '
'Drives the order-level header in customer-facing PDFs.',
)
@api.depends('order_line.x_fc_customer_spec_id')
def _compute_x_fc_customer_spec_id(self):
for so in self:
specs = so.order_line.mapped('x_fc_customer_spec_id')
so.x_fc_customer_spec_id = specs[:1] if specs else False
class SaleOrderLine(models.Model):
"""Add the Specification picker to the SO line.