<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <record id="sos_travel_plan_view_tree" model="ir.ui.view">
    <field name="name">sos_travel_plan.view.tree</field>
    <field name="model">sos_travel_plan</field>
    <field name="arch" type="xml">
    <tree>
    <field name="plan_id"/>
    <field name="travel_type"/>
    <field name="customer_name"/>
    <field name="customer_location"/>
    <field name="prepared_by_name" string="Prepared By" widget="many2one_avatar_user"/>
    <field name="dept_in_charge_name" string="Department In-Charge" widget="many2one_avatar_user"/>
    <field name="top_management_name" string="Top Management Approved 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>
    <record id="sos_travel_plan_view_panel" model="ir.ui.view">
<field name="name">sos_travel_plan.search</field>
<field name="model">sos_travel_plan</field>
<field name="arch" type="xml">
<search position="inside">
<searchpanel>

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

</searchpanel>
<field name="customer_name" string="Customer Name"/>

</search>

</field>
</record>
            <record id="sos_travel_plan_kanban_view" model="ir.ui.view">
            <field name="name">sos_travel_plan.kanban</field>
            <field name="model">sos_travel_plan</field>
            <field name="arch" type="xml">
                <kanban class="o_kanban_mobile">
                    <field name="travel_type"/>
                    <templates>
                        <t t-name="kanban-box">
                            <div t-attf-class="oe_kanban_global_click sos_card">
                                <div class="row">
                                    <div class="col-9">
                                        <strong><field name="customer_name"/></strong>
                                    </div>
                            
                                </div>
                                <div>
                                    <strong>Travel Type: </strong><field name="travel_type"/><br/>
                                    <strong>Travel Date: </strong><field name="date_of_travel"/><br/>
                                </div>
                            </div>
                        </t>
                    </templates>
                </kanban>
            </field>
        </record>
 <record id="action_travel_plan_list" model="ir.actions.act_window">
    <field name="name">Travel Plan</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">sos_travel_plan</field>
    <field name="view_mode">tree,form,kanban</field>
    <field name="view_id" ref="sos_travel_plan_view_tree"/>
</record>
<record id="sos_travel_plan_form_view" model="ir.ui.view">
    <field name="name">Form</field>
    <field name="model">sos_travel_plan</field>
    <field name="arch" type="xml">
        <form>
         <header>
<button class="btn btn-primary" type="object"
name="action_report_travel_plan"><i class="fa fa-print"></i> Print</button>


</header>
            <sheet>
        <h2 style="text-align: center;text-transform: uppercase;text-shadow: 1px 1p 1px #140718;color: #65407c;padding:5px;">Travel Plan</h2><hr></hr><br></br>  
        <group>
        <group>
        <field name="plan_id"/>
        <field name="travel_type"/>
        <field name="dock_audit_no"/>
        <field name="customer_name"/>
        <field name="customer_location"/>

        </group>
        <group>
        <field name="project_coordinators" widget="many2one_avatar_user"/>
        <field name="persons" widget="many2many_tags"/>
        <field name="date_of_travel"/>
        <field name="duration"/>
        <field name="mode_of_travel"/>
        <field name="advance_req"/>
        </group>

        </group>
                <notebook>
                <page string="Activities">
                <field name="activity_planned"/>
                </page>
                <page string="Return Details">
                <group>
                <group>
                <field name="return_date"/>
                 </group>
        <group>
                <field name="return_mode_of_travel"/>
                </group>
                </group>
                </page>
                </notebook>
                 <br></br> <hr></hr>
                        <templates>
    <div class="row">
    <div class="col-md-6" style="box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;background-color: #fff;border: solid 4px #9689c1;        padding-right: 0px;padding-left: 0px;">
       <table class="table">
     <tr><td colspan="2" class="table_custom_header">To Be Filled By <span style="font-size: 18px;padding: 0px; color: #ffcc00;">User</span></td></tr>

        <tr>
            <td style="padding: 8px;" class="column"><b>Prepared By</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-md-6" style="box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;background-color: #fff;border: solid 4px #9689c1;        padding-right: 0px;padding-left: 0px;">
       <table class="table">
         <tr><td colspan="2" class="table_custom_header">To Be Filled By <span style="font-size: 18px;padding: 0px; color: #ffcc00;">Department Incharge</span></td></tr>

        <tr>
            <td style="padding: 8px;" class="column"><b>Department Incharge</b>
                <button string="Approve" invisible="dept_in_charge_image" class="btn-primary custom_btn" type="object" name="action_deptincharge_esign_btn"></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>
      <div class="row">
     <div class="col-md-6" style="box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;background-color: #fff;border: solid 4px #9689c1;        padding-right: 0px;padding-left: 0px;">

       <table class="table">
     <tr><td colspan="2" class="table_custom_header">To Be Filled By <span style="font-size: 18px;padding: 0px; color: #ffcc00;">Top Management</span></td></tr>

        <tr>
            <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_topmanagement_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-md-6" style="box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;background-color: #fff;border: solid 4px #9689c1;        padding-right: 0px;padding-left: 0px;">

       <table class="table">
     <tr><td colspan="2" class="table_custom_header">To Be Filled By <span style="font-size: 18px;padding: 0px; color: #ffcc00;">HR Department</span></td></tr>
        <tr>
            <td style="padding: 8px;" class="column"><b>Remarks</b>
            </td>
            <td><field name="hr_remarks"/></td>
        </tr>
        <tr>
            <td style="padding: 8px;" class="column"><b>Ticket</b>
            </td>
            <td><field name="ticket"  widget="binary" filename="ticket_filename"/><field name="ticket_filename"  invisible="1"/> <button name="action_view_ticket" invisible="not ticket" string="View Ticket" type="object" class="btn-primary" icon="fa-eye"/>
</td>
        </tr>
        <tr>
            <td style="padding: 8px;" class="column"><b>Return Ticket</b>
            </td>
            <td><field name="return_ticket"  widget="binary" filename="return_ticket_filename"/><field name="return_ticket_filename"  invisible="1"/> <button name="action_view_returnticket" invisible="not return_ticket" string="View Ticket" type="object" class="btn-primary" icon="fa-eye"/>
</td>
        </tr>
        <tr>
            <td style="padding: 8px;" class="column"><b>HR Sign</b>
                <button string="Approve" invisible="hr_in_charge_image" class="btn-primary custom_btn" type="object" name="action_hr_esign_btn"></button>
            </td>
            <td><field name="hr_in_charge_image" widget="image"/></td>
        </tr>
        <tr invisible="hr_in_charge_image == False">
            <td style="padding: 8px;" class="column"><b>Approved On</b></td>
            <td><field name="hr_in_charge_approved_on" readonly="1"/></td>
        </tr>
        <tr invisible="hr_in_charge_image == False">
            <td style="padding: 8px;" class="column"><b>Approved By</b></td>
            <td><field name="hr_in_charge_name" readonly="1"/></td>
        </tr>
    </table>
    </div>
    </div>

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


              <menuitem id="travel_plan_menu"
              name="Travel Plan"
              parent="travel_root_menu"
              action="action_travel_plan_list" groups="sos_inventory.sos_ce_user,sos_inventory.sos_ce_head,sos_inventory.sos_finance_user,sos_inventory.sos_management_user,sos_inventory.sos_hr_user,sos_inventory.sos_sales_user,sos_inventory.sos_qc_user,sos_inventory.sos_production_user,sos_inventory.sos_qc_user,sos_inventory.sos_qa_user,sos_inventory.sos_rd_user"/>
              
</odoo>
