<?xml version="1.0" encoding="UTF-8"?>
<odoo>


 <record id="action_dr_form_list" model="ir.actions.act_window">
    <field name="name">Disposal Register</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">sos_disposal_register</field>
    <field name="view_mode">tree,form,kanban</field>

</record>
<record id="sos_disposal_register_view_panel" model="ir.ui.view">
<field name="name">sos_disposal_register.search</field>
<field name="model">sos_disposal_register</field>
<field name="arch" type="xml">

<search position="inside">
<searchpanel>

<field name="goods_type" string="Type" icon="fa-list" enable_counters="1"/>

</searchpanel>
 <field name="ncmr_no" string="NCMR No"/>

</search>

</field>
</record>
    <record id="sos_disposal_register_view_tree" model="ir.ui.view">
        <field name="name">sos_disposal_register.view.tree</field>
        <field name="model">sos_disposal_register</field>
        <field name="arch" type="xml">
            <tree>
            <field name="dr_no"/>
            <field name="ncmr_no"/>
            <field name="ncmr_date"/>
            <field name="customer_name"/>
            <field name="supplier_name"/>
            <field name="material_name" optional="hide"/>
            <field name="sfg_name" optional="hide"/>
            <field name="fg_name" optional="hide"/>
            <field name="top_management_name" string="Top Management Approved By" widget="many2one_avatar_user"/>

            <field name="qa_by_name" string="QA In-Charge" 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>
       <record id="sos_disposal_register_form_view" model="ir.ui.view">
      <field name="name">Form</field>
        <field name="model">sos_disposal_register</field>
        <field name="arch" type="xml">
<form string="Model Form">

                              <header>

                 
                            
                </header>
                    <sheet>

<h2 style="text-align: center;text-transform: uppercase;text-shadow: 1px 1p 1px #140718;color: #65407c;padding:5px;">Disposal Register</h2><hr></hr><br></br>  

<group>

<group>
<field name="dr_no"/>
<field name="goods_type"/>
<field name="ncmr_no"/>
<field name="ncmr_date"/>

<field name="aodr_no"/>
<field name="aodr_date"/>
<field name="lot_no"/>
<field name="mfg_date"/>


</group>
<!-- Second Column -->
<group>
<field name="material_name" invisible="goods_type != 'material'"/>
<field name="sfg_name" invisible="goods_type != 'sfg'"/>
<field name="fg_name" invisible="goods_type != 'fg'"/>
<field name="customer_name"/>
<field name="supplier_name"/>
<field name="rejected_qty"/>
<field name="material_qp_no" invisible="goods_type != 'material'"/>
<field name="sfg_qp_no" invisible="goods_type != 'sfg'"/>
<field name="fg_qp_no" invisible="goods_type != 'fg'"/>
<field name="action_on_rejects"/>
<field name="customer_decision" invisible="goods_type != 'fg'"/>
<field name="return_reason"/>
</group>
</group>
                     

                        <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>Prepared by Sign</b>
                <button string="Approve" invisible="prepared_by_image" class="btn-primary custom_btn" type="object" name="action_report_esign_btn"></button>
            </td>
            <td><field name="prepared_by_image" widget="image"/></td>
        </tr>
        <tr invisible="prepared_by_image == False">
            <td style="padding: 8px;" class="column"><b>Prepared On</b></td>
            <td><field name="prepared_on" readonly="1"/></td>
        </tr>
        <tr invisible="prepared_by_image == False">
            <td style="padding: 8px;" class="column"><b>Prepared By</b></td>
            <td><field name="prepared_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>Department Incharge Sign</b>
                <button string="Approve" invisible="dept_in_charge_image" class="btn-primary custom_btn" type="object" name="action_report_esign_btn_dept_incharge"></button>
            </td>
            <td><field name="dept_in_charge_image" widget="image"/></td>
        </tr>
        <tr invisible="dept_in_charge_image == False">
            <td style="padding: 8px;" class="column"><b>Approved On</b></td>
            <td><field name="dept_in_charge_approved_on" readonly="1"/></td>
        </tr>
        <tr invisible="dept_in_charge_image == False">
            <td style="padding: 8px;" class="column"><b>Approved By</b></td>
            <td><field name="dept_in_charge_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>QC Approved By  </b>
                <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>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 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>
            <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 Approved By  </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>
                            </templates>

                    </sheet>
                </form>
        </field>
    </record>
<menuitem id="dr_menu"
              name="Disposal Register"
              parent="cnp_forms_menu_root" action="action_dr_form_list" groups="sos_inventory.sos_healthcare_user,sos_inventory.sos_scg_group_manager,sos_inventory.sos_scg_group_user,sos_inventory.sos_production_user,sos_inventory.sos_qc_user,sos_inventory.sos_management_user,sos_inventory.sos_logistics_user,sos_inventory.sos_rd_user" />
              

</odoo>
