<odoo>
    <data>

        <!-- Main Form View -->
        <record id="view_sos_return_fir_form" model="ir.ui.view">
            <field name="name">sos.return.fir.form</field>
            <field name="model">sos_return_fir</field>
            <field name="arch" type="xml">
                <form string="Return - Batch Release Report">
                    <sheet>
                    <group>
                        <group>
                            <field name="fir_no"/>
                            <field name="fir_date"/>
                            <field name="fg_name"/>
                            <field name="plan_ref_no"/>
                            <field name="customer_name"/>
                            </group>
                            <group>
                            <field name="batch_No"/>
                            <field name="serial_no"/>
                            <field name="mfg_date"/>
                            <field name="sampling_size"/>
                        </group>
                        </group>
                        <notebook>
                            
                            <page string="Summary Report">
                         <group>
                          <field name="batch_size"/>
                          </group>
                          <group>
                          <field name="approved_qty"/>
                          </group>
                          <group>
                          <field name="rejected_qty"/>
                          </group>
                          <group>
                          <field name="rejection_percentage_display"/>
                          </group>
                          <group>
                          <field name="ncmr_ref" invisible="ncmr_ref == False" readonly="1"/>
                          </group>
                         </page>
                            <!-- Testing Parameter Line Items -->
                             <page string="Inspection Remarks">
                            <field name="testing_parameter_line_ids">
                            <tree editable="bottom">
                            <field name="testing_parameter"/>
                            <field name="specification"/>
                            <field name="results"/>
                            <field name="sampled_qty"/>
                            <field name="accepted_qty"/>
                            <field name="rejected_qty"/>
                            <field name="inspection_decision"/>
                            <field name="remarks"/>

                            </tree>
                            </field>
                            </page>
                             <!-- Calibration Line Items -->

                            <page string="Monitoring &amp; Measuring Equipments">
                                <field name="calibration_line_ids">
                                    <tree editable="bottom">
                                        <field name="calibration_device"/>
                                        <field name="identification_No"/>
                                        <field name="certification_No"/>
                                        <field name="calibrated_date"/>
                                        <field name="due_date"/>
                                    </tree>
                                </field>
                            </page>
                            <page string="Rework History">
                         <group>
                         <field name="reworked_count"/>
                         </group>
                       
                         </page>
                        </notebook>
<templates>

<div class="row">
<div class="col-4">
<table class="table_custom" style="box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;background-color: #fff;border: solid 4px #9689c1;">
        <tr style="border-bottom: solid 1px #ccc;">
            <td style="padding: 8px;" class="column"><b>Stores Provided by Sign</b>
            <br></br><br></br>
                <button string="Approve" invisible="stores_provided_image" class="btn-primary custom_btn" type="object" name="action_stores_provide_esign_btn"></button>
            </td>
            <td><field name="stores_provided_image" widget="image"/></td>
        </tr>
        <tr invisible="stores_provided_image == False">
            <td style="padding: 8px;" class="column"><b>Provided On</b></td>
            <td><field name="stores_provided_on" readonly="1"/></td>
        </tr>
        <tr invisible="stores_provided_image == False">
            <td style="padding: 8px;" class="column"><b>Provided By</b></td>
            <td><field name="stores_provided_by" readonly="1"/></td>
        </tr>
    </table>
</div>
<div class="col-4">
    <!-- First Table -->
   <table class="table_custom" style="box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;background-color: #fff;border: solid 4px #9689c1;">

        <tr style="border-bottom: solid 1px #ccc;">
            <td style="padding: 8px;" class="column"><b>QC In-Charge</b>
            <br></br><br></br>
                <button string="Approve" invisible="qc_by_image" class="btn-primary custom_btn" type="object" name="action_qc_esign_btn"></button>
            </td>
            <td><field name="qc_by_image" widget="image"/></td>
        </tr>
        <tr invisible="qc_by_image == False">
            <td style="padding: 8px;" class="column"><b>Approved On</b></td>
            <td><field name="qc_tested_on" readonly="1"/></td>
        </tr>
        <tr invisible="qc_by_image == False">
            <td style="padding: 8px;" class="column"><b>Approved By</b></td>
            <td><field name="qc_by_name" readonly="1"/></td>
        </tr>
    </table>
    </div>
   <div class="col-4">
<table class="table_custom" style="box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;background-color: #fff;border: solid 4px #9689c1;">        <tr style="border-bottom: solid 1px #ccc;">
            <td style="padding: 8px;" class="column"><b>Stores In-Charge</b>
            <br></br><br></br>
                <button string="Approve" invisible="stores_received_image" class="btn-primary custom_btn" type="object" name="action_stores_esign_btn"></button>
            </td>
            <td><field name="stores_received_image" widget="image"/></td>
        </tr>
        <tr invisible="stores_received_image == False">
            <td style="padding: 8px;" class="column"><b>Approved On</b></td>
            <td><field name="stores_received_on" readonly="1"/></td>
        </tr>
        <tr invisible="stores_received_image == False">
            <td style="padding: 8px;" class="column"><b>Approved By</b></td>
            <td><field name="stores_received_by" readonly="1"/></td>
        </tr>
    </table>
</div>

</div>
<br></br>

<div class="row">


    <div class="col-12">
   <table class="table_custom" style="box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;background-color: #fff;border: solid 4px #9689c1;">
<tr>
            <td style="padding: 8px;" class="column"><b>QA Comments</b></td>
            
            <td><field name="qa_comments"/></td>
        </tr>
        <tr style="border-bottom: solid 1px #ccc;">
            <td style="padding: 8px;" class="column"><b>QA In-Charge</b>
            <br></br><br></br>
                <button string="Approve" invisible="qa_by_image" class="btn-primary custom_btn" type="object" name="action_qa_esign_btn"></button>
            </td>
            <td><field name="qa_by_image" widget="image"/></td>
        </tr>
        <tr invisible="qa_by_image == False">
            <td style="padding: 8px;" class="column"><b>Approved On</b></td>
            <td><field name="qa_tested_on" readonly="1"/></td>
        </tr>
        <tr invisible="qa_by_image == False">
            <td style="padding: 8px;" class="column"><b>Approved By</b></td>
            <td><field name="qa_by_name" readonly="1"/></td>
        </tr>
    </table>
</div>

</div>
</templates>
                    </sheet>
                </form>
            </field>
        </record>

        <!-- Tree View for sos_return_fir -->
        <record id="view_sos_return_fir_tree" model="ir.ui.view">
            <field name="name">sos.return.fir.tree</field>
            <field name="model">sos_return_fir</field>
            <field name="arch" type="xml">
                <tree string="Return - Batch Release Report">
                    <field name="fir_no"/>
                    <field name="fir_date"/>
                    <field name="fg_name"/>
                        <field name="qc_by_name"  string="QC Tested By" widget="many2one_avatar_user"/>
            <field name="qa_by_name"  string="QA Approved By" widget="many2one_avatar_user"/>
            <field name="stores_received_by"  string="Stores Received By" widget="many2one_avatar_user"/>
            <field name="write_uid" string="Last Edited By" optional="hide"/>
                <field name="write_date" string="Last Edited On" optional="hide"/>
       
                </tree>
            </field>
        </record>

        <!-- Action for the model sos_return_fir -->
        <record id="action_sos_return_fir" model="ir.actions.act_window">
            <field name="name">Return - BRR</field>
            <field name="res_model">sos_return_fir</field>
            <field name="view_mode">tree,form</field>
            <field name="help" type="html">
                <p class="o_view_nocontent_smiling_face">
                    Create a New  BRR
                </p>
            </field>
        </record>

        <!-- Menuitem -->
        <menuitem id="menu_sos_return_fir" sequence="4" name="Return - Batch Realease Report (R-BRR)" parent="mop_forms_menu_root" action="action_sos_return_fir" groups="sos_inventory.sos_scg_group_user,sos_inventory.sos_qc_user,sos_inventory.sos_management_user"/>

    </data>
</odoo>
