<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="action_sos_dock_audit_form_list" model="ir.actions.act_window">
    <field name="name">Dock Audit</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">sos_dock_audit</field>
    <field name="view_mode">tree,form</field>

</record>

    <record id="sos_dock_audit_view_tree" model="ir.ui.view">
        <field name="name">sos_dock_audit.view.tree</field>
        <field name="model">sos_dock_audit</field>
        <field name="arch" type="xml">
            <tree>
                <field name="dock_audit_no"/>
                <field name="customer_name"/>
                <field name="customer_location"/>
                <field name="customer_po_no" optional="hide"/>
                <field name="purpose" optional="hide"/>
                <field name="audited_by_name" string="Auditor Approved By" widget="many2one_avatar_user"/>
                <field name="qa_by_name"  string="QA In-Charge Approved By" widget="many2one_avatar_user"/>
                <field name="ce_name" string="CE Approved By" widget="many2one_avatar_user"/>
                <field name="accounts_approved_name" string="Accounts Approved By" widget="many2one_avatar_user"/>
                <field name="top_management_name" string="Top Management Approved By" widget="many2one_avatar_user"/>
                <field name="status" widget="badge" decoration-success="status == 'close'" decoration-danger="status == 'open'"/>
                <field name="write_uid" string="Last Edited By" optional="hide"/>
                <field name="write_date" string="Last Edited On" optional="hide"/>
            </tree>
        </field>
        
    </record>
       <record id="sos_dock_audit_form_view" model="ir.ui.view">
       <field name="name">Form</field>
       <field name="model">sos_dock_audit</field>
       <field name="arch" type="xml">
<form string="Model Form">
    <header>

        <button name="action_open_audit_report_wizard" string="Report"
                type="object" class="btn-primary"/>

        <!-- 
        <button class="btn btn-primary" type="object" 
                 name="action_report_dock_audit_btn">
                <i class="fa fa-print"></i> Print</button> -->

        <button class="btn btn-primary" type="object" name="action_clear_approval"
                invisible="not top_management_name">Make Revision</button>
    </header>
    <sheet>
        <h2 style="text-align: center;text-transform: uppercase;text-shadow: 1px 1p 1px #140718;color: #65407c;padding:5px;">Dock Audit</h2><hr></hr><br></br>  
                        <group>
                        <group>
            <field name="dock_audit_no"/>
            <field name="deliverables_boq_id"/>
           
                <field name="fg_name"/>
                <field name="quantity"/>
                <field name="min_no"/>
                <field name="phase_version" readonly="1"/>
                <!-- <button class="btn btn-primary" type="object"
                           name="action_clear_approval" >Generate Report</button> -->
                </group>
               <group>
                <field name="customer_name"/>
                <field name="customer_location"/>
                <field name="purpose"/>
                <field name="customer_po_no"/>
                <field name="customer_po_date"/>
                <field name="lead_time"/>
                   </group>
                        </group>

<notebook>
<page string="Products">
<notebook>
<page string="Finished Goods">

<field name="line_ids_fg" >
<tree editable="bottom" decoration-success="matched_line">
<field name="matched_line" column_invisible="1"/>
<field name="component_id"/>
<field name="is_spare" widget="boolean_toggle"/>
<field name="uom"/>
<field name="singet_set_qty"/>
<field name="total_set"/>
<field name="quantity"/>
<field name="phase"/>
<!-- <field name="total_phase_count"/> -->
</tree>
</field>
</page>
<page string="Semi Finished Goods">
<field name="line_ids_sfg" >
<tree editable="bottom">
<field name="component_id"/>
<field name="is_spare" widget="boolean_toggle"/>
<field name="uom"/>
<field name="singet_set_qty"/>
<field name="total_set"/>
<field name="quantity"/>
<field name="phase"/>
</tree>
</field>
</page>
<page string="Materials">
<field name="line_ids_material" >
<tree editable="bottom">
<field name="component_id"/>
<field name="is_spare" widget="boolean_toggle"/>

<field name="uom"/>
<field name="singet_set_qty"/>
<field name="total_set"/>
<field name="quantity"/>
<field name="phase"/>
</tree>
</field>
</page>
<page string="Installation Kit">
<field name="line_ids_installation_kit" >
<tree editable="bottom">
<field name="component_id"/>
<field name="uom"/>
<field name="singet_set_qty"/>
<field name="total_set"/>
<field name="quantity"/>
<field name="phase"/>
</tree>
</field>
</page>
<page string="Miscellaneous">
<field name="line_ids_miscellaneous" >
<tree editable="bottom">
<field name="name"/>
<field name="cost"/>
<field name="quantity"/>
<field name="total_price"/>
<field name="phase"/>
</tree>
</field>
</page>

</notebook>

</page>
<page string="Product Verification Status">
<field name="design_verification_ids">
<tree editable="bottom">
<field name="name"/>
<field name="remarks"/>
</tree>
</field>
</page>
<page string="QC Status">
<group>
<group>
<field name="test_report"/>
</group>
<group>
<field name="sdcard_data"/>
</group>
<group>
<field name="cloud_data"/>
</group>
<group>
<field name="sim_provided_status"/>
<field name="sim_number" invisible="sim_provided_status == 'no'"/>
</group>

</group>
</page>
<page string="Installation Guideline &amp; Manual Status">
<group>
<group>
<field name="user_manual"/>
</group>
<group>
<field name="installation_video"/>
</group>
<group>
<field name="wiring_diagram"/>
</group>
<group>
<field name="warranty_card"/>
</group>
</group>


</page>
<page string="Packing Status">
<group>
<group>
<field name="packing_received"/>
</group>
<group>
<field name="correct_product"/>
</group>
<group>
<field name="packaging_correct"/>
</group>
<group>
<field name="labeling_correct"/>
</group>
<group>
<field name="internal_rework"/>
</group>
</group>
</page>
<page string="Commercial Status">
<group>
<group>

<field name="payment_status"/>
<field name="billing_address"/>

</group>
<group>
<field name="invoice_no"/>
<field name="gst_no"/>

<field name="shipping_address"/>
</group>
</group>

</page>



<page string="Revision History">
 
<field name="line_ids_transaction" readonly="1">
<tree editable="bottom">
<field name="phase_version"/>
<field name="audited_by_name"/>
<field name="audited_on" />
<field name="qa_by_name"/>
<field name="qa_tested_on"/>
<field name="ce_name"/>
<field name="ce_approved_on"/>
<field name="accounts_approved_name"/>
<field name="accounts_approved_on"/>
<field name="top_management_name"/>
<field name="top_management_approved_on"/>
</tree>
</field>

</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>Auditor Sign</b>
                <button string="Approve" invisible="audited_by_image" class="btn-primary custom_btn" type="object" name="action_auditor_esign_btn"></button>
            </td>
            <td><field name="audited_by_image" widget="image"/></td>
        </tr>
        <tr invisible="audited_by_image == False">
            <td style="padding: 8px;" class="column"><b>Audited On</b></td>
            <td><field name="audited_on" readonly="1"/></td>
        </tr>
        <tr invisible="audited_by_image == False">
            <td style="padding: 8px;" class="column"><b>Audited By</b></td>
            <td><field name="audited_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>QA Incharge Sign</b>
                <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 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>CE Approved By  </b>
                <button string="Approve" invisible="ce_image" class="btn-primary custom_btn" type="object" name="action_ce_esign_btn"></button>
            </td>
            <td><field name="ce_image" widget="image"/></td>
        </tr>
        <tr invisible="ce_image == False">
            <td style="padding: 8px;" class="column"><b>Approved On</b></td>
            <td><field name="ce_approved_on" readonly="1"/></td>
        </tr>
        <tr invisible="ce_image == False">
            <td style="padding: 8px;" class="column"><b>Approved By</b></td>
            <td><field name="ce_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>Accounts Approved By</b>
                <button string="Approve" invisible="accounts_approved_by_image" class="btn-primary custom_btn" type="object" name="action_acc_esign_btn"></button>
            </td>
            <td><field name="accounts_approved_by_image" widget="image"/></td>
        </tr>
        <tr invisible="accounts_approved_by_image == False">
            <td style="padding: 8px;" class="column"><b>Approved On</b></td>
            <td><field name="accounts_approved_on" readonly="1"/></td>
        </tr>
        <tr invisible="accounts_approved_by_image == False">
            <td style="padding: 8px;" class="column"><b>Approved By</b></td>
            <td><field name="accounts_approved_name" readonly="1"/></td>
        </tr>
    </table>
    </div>
    <div class="col-4">
</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>Top Management</b>
                <button string="Approve" invisible="top_management_approval_image" class="btn-primary custom_btn" type="object" name="action_top_esign_btn"></button>
            </td>
            <td><field name="top_management_approval_image" widget="image"/></td>
        </tr>
        <tr invisible="top_management_approval_image == False">
            <td style="padding: 8px;" class="column"><b>Approved On</b></td>
            <td><field name="top_management_approved_on" readonly="1"/></td>
        </tr>
        <tr invisible="top_management_approval_image == False">
            <td style="padding: 8px;" class="column"><b>Approved By</b></td>
            <td><field name="top_management_name" readonly="1"/></td>
        </tr>
    </table>
    </div>
</div>
        </templates>

                    </sheet>
                </form>
        </field>
    </record>
<menuitem id="sos_dock_audit_menu"
              name="Dock Audit"
              parent="scg_forms_menu_root" action="action_sos_dock_audit_form_list" groups="sos_inventory.sos_sales_user,sos_inventory.sos_scg_group_manager,sos_inventory.sos_scg_group_user,sos_inventory.sos_ce_user,sos_inventory.sos_rd_user,sos_inventory.sos_production_user,sos_inventory.sos_qc_user,sos_inventory.sos_management_user,sos_inventory.sos_logistics_user,sos_inventory.sos_finance_user" />
              

</odoo>