New template: fusion_plating_reports.coc_body_chronological.
Walks fp.job.step.move records in time order (chain-of-custody).
Per-move heading 'Step Name (Tank Code)' with 'Moved By / Time / Qty'
meta line + a 5-column measurement sub-table (Name / Description /
Target / Actual / Recorded By) when the destination step has captured
inputs. Heading-only when there are no inputs (gating moves).
New router template: coc_body_router. Picks chronological vs classic
based on fp.certificate.body_style. Existing certs default to 'classic'
so no regressions. Both English + French CoC templates rerouted.
fp.certificate.body_style ('classic' | 'chronological') exposed on
the cert form alongside certified_by_id. Operator picks per cert.
Sign-off block reuses the existing owner_user_id signature pattern +
x_fc_coc_signature_override fallback. Cert statement boilerplate is
inline (Sub 12d will move it to a configurable per-customer field).
The Actual column in the measurement sub-table is rendered blank
because Sub 12a/12b runtime captures step_input values via the
operator's per-step input form which lives in a model not yet wired
into this template — Sub 12d follow-up.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
235 lines
12 KiB
XML
235 lines
12 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<!-- ============================================================ -->
|
|
<!-- LIST VIEW -->
|
|
<!-- ============================================================ -->
|
|
<record id="fp_certificate_view_list" model="ir.ui.view">
|
|
<field name="name">fp.certificate.list</field>
|
|
<field name="model">fp.certificate</field>
|
|
<field name="arch" type="xml">
|
|
<list default_order="issue_date desc"
|
|
decoration-muted="state == 'draft'"
|
|
decoration-success="state == 'issued'"
|
|
decoration-danger="state == 'voided'">
|
|
<field name="issue_date"/>
|
|
<field name="name"/>
|
|
<field name="certificate_type" widget="badge"/>
|
|
<field name="partner_id"/>
|
|
<field name="part_number"/>
|
|
<field name="po_number"/>
|
|
<field name="entech_wo_number"/>
|
|
<field name="process_description"/>
|
|
<field name="quantity_shipped"/>
|
|
<field name="issued_by_id"/>
|
|
<field name="state" widget="badge"
|
|
decoration-info="state == 'draft'"
|
|
decoration-success="state == 'issued'"
|
|
decoration-danger="state == 'voided'"/>
|
|
</list>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ============================================================ -->
|
|
<!-- FORM VIEW -->
|
|
<!-- ============================================================ -->
|
|
<record id="fp_certificate_view_form" model="ir.ui.view">
|
|
<field name="name">fp.certificate.form</field>
|
|
<field name="model">fp.certificate</field>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<header>
|
|
<button name="action_issue" string="Issue"
|
|
type="object" class="btn-primary"
|
|
invisible="state != 'draft'"/>
|
|
<button name="action_void" string="Void"
|
|
type="object" class="btn-danger"
|
|
invisible="state != 'issued'"/>
|
|
<button name="action_send_to_customer" string="Send to Customer"
|
|
type="object"
|
|
invisible="state != 'issued'"/>
|
|
<field name="state" widget="statusbar"
|
|
statusbar_visible="draft,issued"/>
|
|
</header>
|
|
<sheet>
|
|
<div class="oe_button_box" name="button_box">
|
|
<button name="action_view_traceability"
|
|
type="object"
|
|
class="oe_stat_button"
|
|
icon="fa-sitemap"
|
|
invisible="batch_count == 0">
|
|
<field name="batch_count" widget="statinfo"
|
|
string="Batches"/>
|
|
</button>
|
|
</div>
|
|
<div class="oe_title">
|
|
<h1>
|
|
<field name="name" readonly="1"/>
|
|
</h1>
|
|
</div>
|
|
<group>
|
|
<group>
|
|
<field name="certificate_type"/>
|
|
<field name="partner_id"/>
|
|
<field name="sale_order_id"/>
|
|
<field name="portal_job_id"/>
|
|
<field name="issue_date"/>
|
|
</group>
|
|
<group>
|
|
<field name="part_number"/>
|
|
<field name="po_number"/>
|
|
<field name="entech_wo_number"/>
|
|
<field name="customer_job_no"/>
|
|
<field name="process_description"/>
|
|
<field name="spec_reference"/>
|
|
<field name="quantity_shipped"/>
|
|
<field name="nc_quantity"/>
|
|
<field name="contact_partner_id"
|
|
options="{'no_create': True}"
|
|
invisible="not partner_id"/>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<group>
|
|
<field name="issued_by_id"/>
|
|
<field name="certified_by_id"/>
|
|
<field name="body_style"/>
|
|
</group>
|
|
<group>
|
|
<field name="reading_count" readonly="1"/>
|
|
<field name="mean_nip_mils" readonly="1"/>
|
|
</group>
|
|
</group>
|
|
<group string="SPC — Statistical Process Control">
|
|
<group>
|
|
<field name="spec_min_mils"/>
|
|
<field name="spec_max_mils"/>
|
|
<field name="min_reading_mils" readonly="1"/>
|
|
<field name="max_reading_mils" readonly="1"/>
|
|
<field name="std_dev_mils" readonly="1"/>
|
|
</group>
|
|
<group>
|
|
<field name="cpk" readonly="1"/>
|
|
<field name="cpk_status" readonly="1" widget="badge"
|
|
decoration-success="cpk_status in ('capable','excellent')"
|
|
decoration-warning="cpk_status == 'marginal'"
|
|
decoration-danger="cpk_status == 'incapable'"
|
|
decoration-muted="cpk_status == 'insufficient'"/>
|
|
<field name="trend_alert" readonly="1" widget="badge"
|
|
decoration-success="trend_alert == 'ok'"
|
|
decoration-warning="trend_alert == 'warning'"
|
|
decoration-danger="trend_alert == 'alert'"/>
|
|
<field name="trend_explanation" readonly="1"
|
|
invisible="trend_alert == 'ok'"/>
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="Thickness Readings" name="readings">
|
|
<field name="thickness_reading_ids">
|
|
<list editable="bottom">
|
|
<field name="reading_number"/>
|
|
<field name="nip_mils"/>
|
|
<field name="ni_percent"/>
|
|
<field name="p_percent"/>
|
|
<field name="position_label"/>
|
|
<field name="equipment_model"/>
|
|
<field name="operator_id"/>
|
|
<field name="reading_datetime"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
<page string="Certificate PDF" name="pdf">
|
|
<group>
|
|
<field name="attachment_id"/>
|
|
</group>
|
|
</page>
|
|
<page string="Void" name="void"
|
|
invisible="state != 'voided'">
|
|
<group>
|
|
<field name="void_reason"/>
|
|
</group>
|
|
</page>
|
|
<page string="Notes" name="notes">
|
|
<field name="notes"/>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
<chatter>
|
|
<field name="message_follower_ids"/>
|
|
<field name="activity_ids"/>
|
|
<field name="message_ids"/>
|
|
</chatter>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ============================================================ -->
|
|
<!-- SEARCH VIEW -->
|
|
<!-- ============================================================ -->
|
|
<record id="fp_certificate_view_search" model="ir.ui.view">
|
|
<field name="name">fp.certificate.search</field>
|
|
<field name="model">fp.certificate</field>
|
|
<field name="arch" type="xml">
|
|
<search>
|
|
<field name="name"/>
|
|
<field name="partner_id"/>
|
|
<field name="part_number"/>
|
|
<field name="po_number"/>
|
|
<field name="entech_wo_number"/>
|
|
<separator/>
|
|
<filter name="filter_coc" string="CoC"
|
|
domain="[('certificate_type', '=', 'coc')]"/>
|
|
<filter name="filter_thickness" string="Thickness Report"
|
|
domain="[('certificate_type', '=', 'thickness_report')]"/>
|
|
<filter name="filter_mill_test" string="Mill Test"
|
|
domain="[('certificate_type', '=', 'mill_test')]"/>
|
|
<filter name="filter_nadcap" string="Nadcap"
|
|
domain="[('certificate_type', '=', 'nadcap_cert')]"/>
|
|
<separator/>
|
|
<filter name="filter_draft" string="Draft"
|
|
domain="[('state', '=', 'draft')]"/>
|
|
<filter name="filter_issued" string="Issued"
|
|
domain="[('state', '=', 'issued')]"/>
|
|
<filter name="filter_voided" string="Voided"
|
|
domain="[('state', '=', 'voided')]"/>
|
|
<separator/>
|
|
<filter name="filter_this_week" string="This Week"
|
|
domain="[('issue_date', '>=', (context_today() - relativedelta(weeks=1)).strftime('%Y-%m-%d'))]"/>
|
|
<filter name="filter_this_month" string="This Month"
|
|
domain="[('issue_date', '>=', context_today().strftime('%Y-%m-01'))]"/>
|
|
<separator/>
|
|
<group>
|
|
<filter name="group_customer" string="Customer"
|
|
context="{'group_by': 'partner_id'}"/>
|
|
<filter name="group_type" string="Type"
|
|
context="{'group_by': 'certificate_type'}"/>
|
|
<filter name="group_issued_by" string="Issued By"
|
|
context="{'group_by': 'issued_by_id'}"/>
|
|
<filter name="group_month" string="Month"
|
|
context="{'group_by': 'issue_date:month'}"/>
|
|
</group>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ============================================================ -->
|
|
<!-- WINDOW ACTION -->
|
|
<!-- ============================================================ -->
|
|
<record id="action_fp_certificate" model="ir.actions.act_window">
|
|
<field name="name">Certificates</field>
|
|
<field name="res_model">fp.certificate</field>
|
|
<field name="view_mode">list,form</field>
|
|
<field name="search_view_id" ref="fp_certificate_view_search"/>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
Create your first certificate
|
|
</p>
|
|
<p>
|
|
Certificates of Conformance, thickness reports, and other quality
|
|
documents are tracked here.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
|
|
</odoo>
|