Garment_ERP/addons/garment_erp/views/quality_control_views.xml
2026-09-21 16:43:23 +05:30

128 lines
6.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Defect Type Views -->
<record id="view_garment_defect_type_list" model="ir.ui.view">
<field name="name">garment.defect.type.list</field>
<field name="model">garment.defect.type</field>
<field name="arch" type="xml">
<list string="Defect Categories">
<field name="code"/>
<field name="name"/>
<field name="category"/>
<field name="severity" widget="badge"/>
<field name="active"/>
</list>
</field>
</record>
<record id="action_garment_defect_type" model="ir.actions.act_window">
<field name="name">Quality Defect Master</field>
<field name="res_model">garment.defect.type</field>
<field name="view_mode">list,form</field>
</record>
<!-- Quality Inspection Views -->
<record id="view_garment_quality_inspection_list" model="ir.ui.view">
<field name="name">garment.quality.inspection.list</field>
<field name="model">garment.quality.inspection</field>
<field name="arch" type="xml">
<list string="Quality Audits" sample="1"
decoration-success="verdict == 'passed'"
decoration-warning="verdict == 'rework_needed'"
decoration-danger="verdict == 'rejected'">
<field name="name"/>
<field name="inspection_stage"/>
<field name="production_plan_id"/>
<field name="style_id"/>
<field name="color_id"/>
<field name="size_id"/>
<field name="sample_size" sum="Total Sampled"/>
<field name="passed_qty" sum="Total Passed"/>
<field name="failed_qty" sum="Total Defective"/>
<field name="rework_qty" sum="Total Rework"/>
<field name="inspector_id"/>
<field name="date_inspected"/>
<field name="verdict" widget="badge"
decoration-success="verdict == 'passed'"
decoration-warning="verdict == 'rework_needed'"
decoration-danger="verdict == 'rejected'"/>
</list>
</field>
</record>
<record id="view_garment_quality_inspection_form" model="ir.ui.view">
<field name="name">garment.quality.inspection.form</field>
<field name="model">garment.quality.inspection</field>
<field name="arch" type="xml">
<form string="Quality Audit &amp; Inspection">
<header>
<button name="action_pass" string="Approve (Pass Audit)" type="object" class="btn-success" invisible="verdict == 'passed'"/>
<button name="action_trigger_rework" string="Create Rework Order" type="object" class="btn-warning" icon="fa-wrench" invisible="verdict == 'rework_needed'"/>
<field name="verdict" widget="statusbar" statusbar_visible="passed,rework_needed,rejected"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_trigger_rework" type="object" class="oe_stat_button" icon="fa-wrench">
<field name="rework_count" widget="statinfo" string="Rework Orders"/>
</button>
</div>
<div class="oe_title">
<label for="name" string="Inspection Audit No"/>
<h1><field name="name"/></h1>
</div>
<group>
<group string="Inspection Point">
<field name="inspection_stage"/>
<field name="production_plan_id"/>
<field name="style_id"/>
<field name="color_id"/>
<field name="size_id"/>
<field name="bundle_id"/>
<field name="sewing_line_id"/>
</group>
<group string="Auditor &amp; Sample Quantities">
<field name="inspector_id"/>
<field name="date_inspected"/>
<field name="total_lot_qty"/>
<field name="sample_size"/>
<field name="passed_qty" class="fw-bold text-success"/>
<field name="failed_qty" class="fw-bold text-danger"/>
<field name="rework_qty" class="fw-bold text-warning"/>
<field name="scrapped_qty"/>
</group>
</group>
<notebook>
<page string="Defect Log Breakdown" name="defects_tab">
<field name="defect_line_ids">
<list editable="bottom">
<field name="defect_type_id"/>
<field name="category"/>
<field name="defect_count" sum="Total Defects"/>
<field name="action_type"/>
<field name="notes"/>
</list>
</field>
</page>
<page string="Inspector Notes &amp; Root Cause" name="notes_tab">
<field name="remarks" placeholder="Root cause analysis (e.g. blunt needle on Overlock machine 4, improper operator tension, fabric slub)..."/>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<!-- Action & Menu -->
<record id="action_garment_quality_inspection" model="ir.actions.act_window">
<field name="name">Quality Inspections</field>
<field name="res_model">garment.quality.inspection</field>
<field name="view_mode">list,form</field>
</record>
<menuitem id="menu_garment_quality_inspection" name="Quality Inspections (QC)" parent="menu_garment_quality_root" action="action_garment_quality_inspection" sequence="10"/>
<menuitem id="menu_garment_defect_type" name="Defect Categories Master" parent="menu_garment_quality_root" action="action_garment_defect_type" sequence="30"/>
</odoo>