feat(jobs): persist Customer Job # + PO # + Rush Order on fp.job
Tier 1 of the SO->fp.job persistence audit. Three customer-reference fields entered on sale.order's Plating tab were not flowing through to fp.job (or SO lines), so the shop floor and printed paperwork (traveller, BoL, cert) had to round-trip via sale_order_id every time. Changes: - fp.job: new x_fc_customer_job_number (Char, tracking), x_fc_po_number (Char, tracking), x_fc_rush_order (Boolean, tracking). All three populated by _fp_auto_create_job at SO confirm time. - sale.order.line: x_fc_customer_job_number / x_fc_po_number added as stored related fields off order_id so per-line list views show the customer's references without navigating to the order header (x_fc_rush_order was already on lines). - fp.job form view: small Customer References group under the title surfaces the three fields where the user expects them. Verified end-to-end: SO -> SO line related fields -> fp.job direct fields all carry the same value. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -322,6 +322,16 @@ class SaleOrder(models.Model):
|
||||
if recipe:
|
||||
vals['recipe_id'] = recipe.id
|
||||
|
||||
# Customer references — mirror onto the job so the shop floor
|
||||
# has them without round-tripping to the SO.
|
||||
if 'x_fc_customer_job_number' in self._fields \
|
||||
and self.x_fc_customer_job_number:
|
||||
vals['x_fc_customer_job_number'] = self.x_fc_customer_job_number
|
||||
if 'x_fc_po_number' in self._fields and self.x_fc_po_number:
|
||||
vals['x_fc_po_number'] = self.x_fc_po_number
|
||||
if 'x_fc_rush_order' in self._fields:
|
||||
vals['x_fc_rush_order'] = bool(self.x_fc_rush_order)
|
||||
|
||||
# Customer spec / facility / manager — copy from SO if present
|
||||
if 'x_fc_customer_spec_id' in self._fields and self.x_fc_customer_spec_id:
|
||||
vals['customer_spec_id'] = self.x_fc_customer_spec_id.id
|
||||
|
||||
Reference in New Issue
Block a user