fp.receiving simplifies to box-count-only (new primary state machine: draft → counted → staged → closed). Legacy inspecting/accepted/discrepancy/resolved states stay in the Selection so existing records load without error but are surfaced behind a manager-only toggle. New box_count_in field + banner that tells the receiver "count boxes only — parts are inspected by the racking crew." New fp.racking.inspection + fp.racking.inspection.line models — one record per MO, auto-created by mrp.production.create() with one line per contributing SO line (qty_expected seeded, qty_found + condition filled in by the racking crew when they open the boxes). State: draft → inspecting → done | discrepancy_flagged (flagged when any line has a non-ok condition or qty variance). Reopen restricted to Plating Manager. WO soft gate: first plating WO button_start raises a UserError when the MO's racking inspection is still Draft or Inspecting. Plating Manager bypasses; later WOs are not gated. fp.delivery gains x_fc_box_count_out. action_mark_delivered calls _fp_check_box_parity which posts a non-blocking chatter warning when boxes out ≠ boxes in (resolved via job_ref → MO.origin → SO → receiving). Warning only — never blocks shipping. Menu entry: Plating → Operations → Racking Inspection. Module version bumps: fusion_plating_receiving → 19.0.3.0.0 fusion_plating_logistics → 19.0.3.0.0 fusion_plating_bridge_mrp → 19.0.12.0.0 (+depends receiving) Smoke on entech: 12/12 assertions pass (one gate test skipped — MO had no WOs to test) including box-count state machine, inspection auto-create, lifecycle, discrepancy flag, and box-parity chatter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
200 lines
9.7 KiB
XML
200 lines
9.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!--
|
|
Copyright 2026 Nexa Systems Inc.
|
|
License OPL-1 (Odoo Proprietary License v1.0)
|
|
Part of the Fusion Plating product family.
|
|
-->
|
|
<odoo>
|
|
|
|
<!-- ===== Receiving List View ===== -->
|
|
<record id="view_fp_receiving_list" model="ir.ui.view">
|
|
<field name="name">fp.receiving.list</field>
|
|
<field name="model">fp.receiving</field>
|
|
<field name="arch" type="xml">
|
|
<list string="Receiving"
|
|
decoration-warning="state == 'discrepancy'"
|
|
decoration-success="state == 'accepted'"
|
|
decoration-muted="state == 'resolved'"
|
|
default_order="received_date desc">
|
|
<field name="received_date"/>
|
|
<field name="name"/>
|
|
<field name="sale_order_id"/>
|
|
<field name="partner_id"/>
|
|
<field name="po_number"/>
|
|
<field name="expected_qty"/>
|
|
<field name="received_qty"/>
|
|
<field name="qty_match" widget="boolean"/>
|
|
<field name="state" widget="badge"
|
|
decoration-info="state == 'draft'"
|
|
decoration-warning="state in ('inspecting', 'discrepancy')"
|
|
decoration-success="state == 'accepted'"
|
|
decoration-muted="state == 'resolved'"/>
|
|
</list>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ===== Receiving Form View ===== -->
|
|
<record id="view_fp_receiving_form" model="ir.ui.view">
|
|
<field name="name">fp.receiving.form</field>
|
|
<field name="model">fp.receiving</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Receiving">
|
|
<header>
|
|
<!-- Sub 8 — new primary flow: box count only -->
|
|
<button name="action_mark_counted"
|
|
string="Mark Counted"
|
|
type="object"
|
|
class="btn-primary"
|
|
invisible="state not in ('draft', 'inspecting')"/>
|
|
<button name="action_mark_staged"
|
|
string="Stage for Racking"
|
|
type="object"
|
|
class="btn-primary"
|
|
invisible="state != 'counted'"/>
|
|
<button name="action_close"
|
|
string="Close"
|
|
type="object"
|
|
invisible="state not in ('staged', 'accepted', 'resolved')"/>
|
|
<!-- Legacy actions (hidden by default; surfaces for old records) -->
|
|
<button name="action_accept"
|
|
string="Accept (legacy)"
|
|
type="object"
|
|
invisible="state != 'inspecting'"
|
|
groups="fusion_plating.group_fusion_plating_manager"/>
|
|
<button name="action_flag_discrepancy"
|
|
string="Flag Discrepancy (legacy)"
|
|
type="object"
|
|
class="btn-danger"
|
|
invisible="state != 'inspecting'"
|
|
groups="fusion_plating.group_fusion_plating_manager"/>
|
|
<button name="action_resolve"
|
|
string="Resolve (legacy)"
|
|
type="object"
|
|
invisible="state != 'discrepancy'"
|
|
groups="fusion_plating.group_fusion_plating_manager"/>
|
|
<field name="state" widget="statusbar"
|
|
statusbar_visible="draft,counted,staged,closed"/>
|
|
</header>
|
|
<sheet>
|
|
<div class="alert alert-info" role="alert">
|
|
<i class="fa fa-info-circle me-2"/>
|
|
<strong>Receiving = box count only.</strong>
|
|
Count the boxes the truck dropped off, set the number
|
|
below, and stage them for racking. The racking crew
|
|
opens the boxes and inspects each part — see
|
|
<em>Plating → Operations → Racking Inspection</em>.
|
|
</div>
|
|
<div class="oe_title">
|
|
<h1>
|
|
<field name="name" readonly="1"/>
|
|
</h1>
|
|
</div>
|
|
<group>
|
|
<group>
|
|
<field name="sale_order_id"/>
|
|
<field name="partner_id"/>
|
|
<field name="po_number"/>
|
|
</group>
|
|
<group string="Box Count">
|
|
<field name="box_count_in"/>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<group string="Reception">
|
|
<field name="received_by_id"/>
|
|
<field name="received_date"/>
|
|
<field name="carrier_name"/>
|
|
<field name="carrier_tracking"/>
|
|
</group>
|
|
<group string="Quantities (populated by racking crew)">
|
|
<field name="expected_qty" readonly="1"/>
|
|
<field name="received_qty" readonly="1"/>
|
|
<field name="qty_match" widget="boolean_toggle" readonly="1"/>
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="Receiving Lines" name="lines">
|
|
<field name="line_ids">
|
|
<list editable="bottom">
|
|
<field name="part_number"/>
|
|
<field name="description"/>
|
|
<field name="expected_qty"/>
|
|
<field name="received_qty"/>
|
|
<field name="condition"/>
|
|
<field name="notes"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
<page string="Damage Log" name="damage">
|
|
<field name="damage_ids">
|
|
<list editable="bottom">
|
|
<field name="description"/>
|
|
<field name="severity" widget="badge"
|
|
decoration-info="severity == 'cosmetic'"
|
|
decoration-warning="severity == 'functional'"
|
|
decoration-danger="severity == 'rejected'"/>
|
|
<field name="action_required"/>
|
|
<field name="customer_notified"/>
|
|
<field name="resolved"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
<page string="Photos" name="photos">
|
|
<field name="attachment_ids" widget="many2many_binary"/>
|
|
</page>
|
|
<page string="Notes" name="notes">
|
|
<field name="notes"
|
|
placeholder="Internal notes about this receiving..."/>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
<chatter/>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ===== Receiving Search View ===== -->
|
|
<record id="view_fp_receiving_search" model="ir.ui.view">
|
|
<field name="name">fp.receiving.search</field>
|
|
<field name="model">fp.receiving</field>
|
|
<field name="arch" type="xml">
|
|
<search>
|
|
<field name="name"/>
|
|
<field name="sale_order_id"/>
|
|
<field name="partner_id"/>
|
|
<field name="po_number"/>
|
|
<separator/>
|
|
<filter string="Awaiting Parts" name="draft" domain="[('state', '=', 'draft')]"/>
|
|
<filter string="Inspecting" name="inspecting" domain="[('state', '=', 'inspecting')]"/>
|
|
<filter string="Discrepancy" name="discrepancy" domain="[('state', '=', 'discrepancy')]"/>
|
|
<filter string="Accepted" name="accepted" domain="[('state', '=', 'accepted')]"/>
|
|
<group>
|
|
<filter string="Customer" name="group_customer" context="{'group_by': 'partner_id'}"/>
|
|
<filter string="Status" name="group_state" context="{'group_by': 'state'}"/>
|
|
<filter string="Received Date" name="group_received_date" context="{'group_by': 'received_date:month'}"/>
|
|
</group>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ===== Window Action ===== -->
|
|
<record id="action_fp_receiving" model="ir.actions.act_window">
|
|
<field name="name">Receiving</field>
|
|
<field name="res_model">fp.receiving</field>
|
|
<field name="view_mode">list,form</field>
|
|
<field name="search_view_id" ref="view_fp_receiving_search"/>
|
|
<field name="context">{'search_default_draft': 1}</field>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
No receiving records yet
|
|
</p>
|
|
<p>
|
|
Receiving records are created automatically when a sale order is
|
|
confirmed. They track quantity verification, condition inspection,
|
|
and damage logging for customer parts arriving at the shop.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
|
|
</odoo>
|