<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="sos_sfg_view_panel" model="ir.ui.view">
<field name="name">sos_sfg.search</field>
<field name="model">sos_sfg</field>
<field name="arch" type="xml">
<search position="inside">
<searchpanel>

<field name="sfg_type" string="Type" icon="fa-list-ul" enable_counters="1"/>
<field name="category" string="Category" icon="fa-pie-chart" enable_counters="1"/>

</searchpanel>
 <field name="sfg_code" string="Code"/>
<field name="name" string="Name"/>
</search>
</field>
</record>
<record id="sos_sfg_view_subpanel" model="ir.ui.view">
<field name="name">sos_sfg.search</field>
<field name="model">sos_sfg</field>
<field name="arch" type="xml">
<search position="inside">

 <field name="sfg_code" string="Code"/>
<field name="name" string="Name"/>
</search>
</field>
</record>
     <record id="action_owl_sfg_dashboard" model="ir.actions.client">
            <field name="name">Dashboard</field>
            <field name="tag">owl.sfg_dashboards</field>
        </record>
    <record id="sos_sfg_view_tree" model="ir.ui.view">
        <field name="name">sos_sfg.view.tree</field>
        <field name="model">sos_sfg</field>
        <field name="arch" type="xml">

             <tree>
            <header>
   <button name="%(action_owl_sfg_dashboard)d" string="Dashboard" type="action" class="oe_highlight" display="always"/>
</header>
<field name="code_no"/>
                   <field name="sfg_code"/>
                    <field name="name"/>
                    <field name="unit_price"/>
                    <field name="location" string="Location"/>
                    <field name="inhand_stock_qty"/>
                    <field name="image" widget="image" class="oe_avatar" optional="hide"/>
             <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_sfg_view_subtree" model="ir.ui.view">
        <field name="name">sos_sfg.view.tree</field>
        <field name="model">sos_sfg</field>
        <field name="arch" type="xml">

            <tree editable="bottom">
                   <field name="sfg_code" readonly="1"/>
                    <field name="name" readonly="1"/>
                    <field name="last_batch_no"/>
                    <field name="last_serial_no"/>
                
            </tree>
        </field>
    </record>
            <record id="sos_sfg_kanban_view" model="ir.ui.view">
            <field name="name">sos_sfg.kanban</field>
            <field name="model">sos_sfg</field>
            <field name="arch" type="xml">
                <kanban class="o_kanban_mobile">
                    <field name="sfg_code"/>
                    <field name="name"/>
                    <field name="sfg_type"/>
                    <templates>
                        <t t-name="kanban-box">
                            <div t-attf-class="oe_kanban_global_click sos_card">
                                <div class="row">
                                    <div class="col-9">
                                        <h4><field name="sfg_code"/></h4>
                                    </div>
                                    <div class="col-3 text-end">
                                    <div class="o_kanban_image">
                                    <img t-att-src="kanban_image('sos_sfg', 'image', record.id.raw_value)" alt="Avatar" class="o_image_64_cover rounded"/>
                                    </div>
                                    </div>
                                </div>
                                <div>
                                    <strong>Name: </strong><t t-out="record.name.value"/><br/>
                                    <strong>Type: </strong><t t-out="record.fg_type.value"/>
                                </div>
                            </div>
                        </t>
                    </templates>
                </kanban>
            </field>
        </record>
 <record id="action_sfg_list" model="ir.actions.act_window">
    <field name="name">Semi-Finished Goods</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">sos_sfg</field>
    <field name="view_mode">tree,form,kanban</field>
    <field name="view_id" ref="sos_sfg_view_tree"/>
</record>
 <record id="action_sfg_sublist" model="ir.actions.act_window">
    <field name="name">Approved SFG List</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">sos_sfg</field>
    <field name="view_mode">tree</field>
    <field name="view_id" ref="sos_sfg_view_subtree"/>
    <field name="context">{'create': False}</field>
    <field name="search_view_id" ref="sos_sfg_view_subpanel"/>
</record>
       <record id="sos_sfg_form_view" model="ir.ui.view">
      <field name="name">Form</field>
        <field name="model">sos_sfg</field>
        <field name="arch" type="xml">
            <form>
            <sheet>
                <h2 style="text-align: center;text-transform: uppercase;text-shadow: 1px 1p 1px #140718;color: #65407c;padding:5px;">Semi-Finished Goods</h2><hr></hr><br></br>
                <group>
                        <group>
                            <field name="sfg_code"/>
                            <field name="sfg_type"/>
                            <field name="category"/>
                            <field name="name"/>
                            <field name="code_no"/>
                            <field name="uom"/>
                            </group>
                              <group>
                <field name="image" widget="image" class="oe_avatar" string=""/>
                
                
                </group>
                <group>
                
                <field name="service_providers" widget="many2many_tags"/>
                            <field name="qp_no"/>
                             <field name="hsn_code"/>
                             <field name="sac_code"/>
                             </group>
                            <group>
                            <field name="assembling_charges"/>
                            <field name="unit_price"/>
                             <field name="msp"/>
                             <field name="order_qty"/>
                             <field name="blocked_qty"/>
                             </group>
                        
               <group>
               <field name="minimum_stock_qty"/>
                            <field name="minimum_order_qty"/>
                        </group>
                        <group>
                            <field name="inhand_stock_qty"/>
                            <field name="inhand_stock_val"/>
                        </group>
                        <group>
                            <field name="received_qty"/>
                            <field name="received_stock_val"/>
                        </group>
                         <group>
                            <field name="in_transit_stock_qty"/>
                            <field name="in_transit_stock_val"/>
</group>
<group>
                            <field name="issued_qty"/>
                             <field name="issued_val"/>
                        </group>
                        <group>
                            <field name="defect_qty"/>
                             <field name="cancelled_qty"/>
                        </group>
                   


              
                  </group>
 
             
                <group>
                 <field name="location"/>
                <field name="description" />
                </group>
          
         <notebook>
                            <page string="IN - History">
                                <field name="line_ids_in">
                                    <tree editable="bottom" delete="false" create="false">
                                    <field name="date"/>
                                        <field name="quantity"/>
                                        <field name="unit_price"/>
                                        <field name="ir_no" readonly="1"/>
                                        <field name="mrn_no" readonly="1"/>
                                        <field name="iqi_no" readonly="1"/>
                                        <field name="action" column_invisible="1"/>
                                       
                                    </tree>
                                 
                                </field>
   
                            </page>
                            <page string="OUT - History">
                                <field name="line_ids_out">
                                    <tree editable="bottom" delete="false" create="false">
                                    <field name="date"/>
                                        <field name="quantity"/>
                                        <field name="min_no"/>
                                        <field name="action" column_invisible="1"/>
                                       
                                    </tree>
                                 
                                </field>
   
                            </page>
                            </notebook>
  
  
                </sheet>
            </form>
        </field>
    </record>

              <menuitem id="sfg_master_menu"
              name="Semi-Finished Goods Stores"
              parent="stores_menu_root"
              action="action_sfg_list" groups="sos_inventory.sos_management_user,sos_inventory.sos_scg_group_manager,sos_inventory.sos_scg_group_user,sos_inventory.sos_finance_user"/>
              <menuitem id="sfg_master_submenu"
              name="Semi-Finished Goods List"
              parent="mop_forms_menu_root"
              action="action_sfg_sublist" groups="sos_inventory.sos_scg_group_user,sos_inventory.sos_qc_user,sos_inventory.sos_production_user"/>
</odoo>
