<odoo>
    <!-- Form View -->
    <record id="view_sos_sales_order_form" model="ir.ui.view">
        <field name="name">sos.sales.order.form</field>
        <field name="model">sos_sales_order</field>
        <field name="arch" type="xml">
            <form string="Delivery Plan / Sales Order">
                  
                <sheet>
                    <group>
                        <group>
                            <field name="order_id"/>
                            <field name="fg_name"/>
                             <field name="qty"/>
                            <field name="customer_name"/>
                        </group>
                        <group>
                            <field name="lead_time"/>
                            <field name="customer_po_no"/>
                            <field name="customer_po_date"/>
                        </group>
                        <group>
                        <!-- <field name="email_to" widget="many2many_tags"/> -->
                        </group>
                        <notebook>
                                               <page string="Specific Requirements">
 <field name="customer_specific" widget="html"/>
                        </page>
                              <page string="Commercial Details">
                         <group>
                        <group>
                         <field name="purpose_of_delivery"/>
                            <field name="payment_status"/>
                            <field name="payment_terms"/>
                            <field name="gst_no"/>
                            <field name="contact_person"/>
                            <field name="contact_no"/>
                     
                            </group>
                            <group>
                       <field name="billing_address"/>
                            <field name="shipping_address"/>
                           
                            </group>
                             </group>
                        </page>


                        <page string="QC Requirements">
                        <group>
                         <field name="test_report"/>
                            <field name="sdcard_data"/>
                            <field name="cloud_data"/>
                            </group>
                        </page>
                        <page string="Installation Requirements">
                        <group>
                        <field name="user_manual"/>
                            <field name="installation_video"/>
                            <field name="wiring_diagram"/>
                            <field name="warranty_card"/>
                            </group>
                        </page>
 <page string="PO Copy">
 <field name="order_copy" filename="order_copy_filename"  widget="pdf_viewer"/>
                                <field name="order_copy_filename" invisible="1"/>
 </page>
                        </notebook>
   
                    </group>
       
                                     <templates>
    <div class="row" style="margin-top:100px">
  <div class="col-6"></div>
  <div class="col-6"> 
     <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>
            <br></br><br></br>
                <button string="Approve" invisible="prepared_by_image" class="btn-primary custom_btn" type="object" name="action_report_esign_btn"></button>
            </td>
            <td><field invisible="prepared_by_image == False" 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>
     </templates>
                </sheet>
 
            </form>
        </field>
    </record>

    <!-- Tree View -->
    <record id="view_sos_sales_order_tree" model="ir.ui.view">
        <field name="name">sos.sales.order.tree</field>
        <field name="model">sos_sales_order</field>
        <field name="arch" type="xml">
            <tree string="Delivery Plan / Sales Order">
                <field name="order_id"/>
                <field name="fg_name"/>
                <field name="customer_name"/>
                <field name="lead_time"/>
                <field name="qty"/>
                <field name="purpose_of_delivery"/>
                <field name="payment_status"/>
                <field name="write_uid" string="Last Edited By" optional="hide"/>
                <field name="write_date" string="Last Edited On" optional="hide"/>
            </tree>
        </field>
    </record>

    <!-- Action -->
    <record id="action_sos_sales_order" model="ir.actions.act_window">
        <field name="name">Sales Order/Sales Plan</field>
        <field name="res_model">sos_sales_order</field>
        <field name="view_mode">tree,form</field>
        <field name="view_id" ref="view_sos_sales_order_tree"/>
    </record>

    <!-- Menu Item -->
    <menuitem id="menu_sos_sales_order" name="Sales Order"
              parent="sales_root_menu" 
              action="action_sos_sales_order" groups="sos_inventory.sos_sales_user,sos_inventory.sos_finance_user,sos_inventory.sos_ce_user,sos_inventory.sos_management_user"/>
</odoo>
