<odoo>
    <!-- Form View for SOS Quote Generation Line -->
    <record id="view_sos_quote_generation_form" model="ir.ui.view">
        <field name="name">sos.quote.generation.form</field>
        <field name="model">sos_quote_generation</field>
        <field name="arch" type="xml">
            <form string="Quote Generation">
            <!-- <header>
                <button name="action_generate_quotation" type="object" string="Generate Quotation" class="btn-primary"/>
            </header> -->
                <sheet>
                  <div style="font-size: 22px;pointer-events: none;color: #793595;">
        <field name="plan_ref_no" nolabel="1" />
    </div>
                   <notebook>
    <page string="Procurement Plan"  id="page1">
    <div style="float: right;margin-bottom:25px" >
    <button type="object" string="Export" class="btn-warning" name="action_export"></button>

     <button style="margin-left: 10px;" name="action_generate_quotation" type="object" string="Generate Quotation" class="btn-primary"/>
</div>
    <field name="line_ids">
    <tree editable="bottom"  create="false">
    <field name="material_name"/>
    <field name="required_qty"/>
    <field name="in_transit_stock_qty"/>
    <field name="purchase_type"/>
    <field name="is_supplier_name_readonly" column_invisible="True"/>
    <field name="supplier_name" widget="many2many_tags" readonly="is_supplier_name_readonly"/>
    <field name="suppliers_ids" column_invisible="True"/>
    <field name="status" widget="badge" decoration-success="status == 'close'" decoration-danger="status == 'open'"/>
    <field name="status" string="Change Status" groups="sos_inventory.sos_scg_group_manager"/>
    </tree>
    </field>
    </page>
                      <page string="Quote Comparison">
    <field name="line_ids">
        <tree editable="bottom" create="false">
                        <field name="material_name"/>
                        <field name="required_qty"/>
                        <field name="supplier1_name"/>
                        <field name="supplier1_qty"/>
                        <field name="supplier1_quoted_price"/>
                        <field name="supplier2_name"/>
                        <field name="supplier2_qty"/>
                        <field name="supplier2_quoted_price"/>
                        <field name="supplier3_name"/>
                        <field name="supplier3_qty"/>
                        <field name="supplier3_quoted_price"/>
                          <field name="best_supplier" decoration-success="best_supplier"/>
                   
                        </tree>
                    </field>
                    </page>
                     <page string="PO Generation">
    <div style="float: right;margin-bottom:25px" >
    
     <button name="action_generate_po" type="object" string="Generate PO" class="btn-primary"/>
</div>
    <field name="line_ids">
        <tree editable="bottom" create="false">
                       <field name="material_name"/>
                        <field name="available_suppliers" column_invisible="1"/>
                        <field name="final_supplier1_name" domain="[('id', 'in', available_suppliers)]" string="Service Provider Name"/>
                        <field name="final_supplier1_qty"/>
                        <field name="final_supplier1_quoted_price"/>
                       
                   
                        </tree>
                    </field>
                    </page>
                    </notebook>
                </sheet>
            </form>
        </field>
    </record>

    <!-- Tree View for SOS Quote Generation Line -->
    <record id="view_sos_quote_generation_tree" model="ir.ui.view">
        <field name="name">sos.quote.generation.tree</field>
        <field name="model">sos_quote_generation</field>
        <field name="arch" type="xml">
             <tree>
                <field name="plan_ref_no"/>
               
            </tree>
        </field>
    </record>

    <!-- Action for SOS Quote Generation Line -->
    <record id="action_sos_quote_generation" model="ir.actions.act_window">
        <field name="name">Procurement Plan</field>
        <field name="res_model">sos_quote_generation</field>
        <field name="view_mode">tree,form</field>
        <field name="view_id" ref="view_sos_quote_generation_tree"/>
    </record>

    <!-- Menu Item for SOS Quote Generation Line -->
    <menuitem id="menu_sos_quote_generation" name="Material Procurement Plan" parent="scg_menu_root" action="action_sos_quote_generation"/>
</odoo>

