Files
Odoo-Modules/fusion_plating/fusion_plating_jobs/views/fp_receiving_views.xml
gsinghpal c80ffa1b2c feat(fusion_plating): internal sticker = external layout w/ internal notes + Receiving print buttons
- Internal Job Sticker is no longer a separate Layout A: it's now a COPY of the
  External sticker (Layout B, one per box, logo + WO + BOX + QR + rail fields +
  prominent PLATING THICKNESS banner) but feeds the INTERNAL description and
  labels its notes "INTERNAL NOTES" so the shop copy can't be confused with the
  customer copy. The old Layout-A body template is deleted.
- Removed the Internal sticker from the fp.job Print menu (binding_model_id ->
  False); it now prints from the Receiving screen instead.
- Added "External Sticker" + "Internal Sticker" print buttons to the fp.receiving
  form header (shown once a WO exists). Each renders one label per tracked box
  for the receiving's work order (passes a single WO so the SO-scoped box loop
  doesn't reprint each label per job).
Verified on entech (WO-30094 / RCV-30096): internal renders Layout B with the
internal description + INTERNAL NOTES; external unchanged; both receiving buttons
return the right report actions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 13:16:14 -04:00

55 lines
2.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Adds the Work Order smart button + header button to fp.receiving so
the receiving form mirrors the SO's WO entry point. Header button
appears once state == 'closed' and at least one linked fp.job is
still open. Smart button is always visible when WOs exist.
-->
<odoo>
<record id="view_fp_receiving_form_fp_jobs" model="ir.ui.view">
<field name="name">fp.receiving.form.fp.jobs</field>
<field name="model">fp.receiving</field>
<field name="inherit_id" ref="fusion_plating_receiving.view_fp_receiving_form"/>
<field name="arch" type="xml">
<!-- Work Order header button — only after receiving is
closed and while at least one job is still open. -->
<xpath expr="//header" position="inside">
<field name="x_fc_show_work_order_btn" invisible="1"/>
<button name="action_view_fp_jobs"
string="Work Order" type="object"
class="btn-primary" icon="fa-cogs"
invisible="not x_fc_show_work_order_btn"
help="Open the Work Order(s) for this receiving. Hidden automatically once every linked WO is marked Done."/>
<!-- Print box stickers for this receiving's work order — one
label per tracked box (external = customer copy, internal
= shop copy with internal notes). Shown once a WO exists. -->
<button name="action_print_external_sticker"
string="External Sticker" type="object" icon="fa-print"
invisible="x_fc_fp_job_count == 0"
help="Print the customer (external) box sticker(s) — one per box."/>
<button name="action_print_internal_sticker"
string="Internal Sticker" type="object" icon="fa-print"
invisible="x_fc_fp_job_count == 0"
help="Print the shop (internal) box sticker(s) — same layout, internal notes."/>
</xpath>
<!-- Work Order smart button on the button_box (mirrors the
one on the SO form). Always visible when count > 0. -->
<xpath expr="//div[@name='button_box']" position="inside">
<button name="action_view_fp_jobs" type="object"
class="oe_stat_button" icon="fa-cogs"
invisible="x_fc_fp_job_count == 0">
<field name="x_fc_fp_job_count" widget="statinfo" string="WO"/>
</button>
</xpath>
</field>
</record>
</odoo>