<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <record id="sos_fg_bom_view_tree" model="ir.ui.view">
        <field name="name">sos_fg_bom.view.tree</field>
        <field name="model">sos_fg_bom</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name"/>
                <field name="fg_name"/>
                <field name="bom_version"/>
                <field name="is_primary" widget="boolean_toggle" readonly="1"/>
                <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="action_fg_bom_list" model="ir.actions.act_window">
    <field name="name">FG BOM</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">sos_fg_bom</field>
    <field name="view_mode">tree,form,kanban</field>
    <field name="view_id" ref="sos_fg_bom_view_tree"/>
       <field name="help" type="html">
        <p class="o_view_nocontent_smiling_face">
        No BOM Found
        </p>
        </field>
</record>
       <record id="sos_fg_bom_form_view" model="ir.ui.view">
      <field name="name">Form</field>
        <field name="model">sos_fg_bom</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;">Finished Goods BOM</h2><hr></hr><br></br>  

<group>
<group>
<field name="name"/>
<field name="fg_name"/>
<field name="bom_version"/>
<field name="responsible_person" widget="many2many_tags"/>


<field name="is_primary" widget="boolean_toggle"/>

</group>

<group style="background-color: #f3dfff;    width: 25%;
    padding: 15px 10px 8px 10px;
    border: solid 1px #ebabff;
    border-radius: 10px;">
<field name="overall_total" widget="monetary" readonly="1" style="font-weight:bold"/>
</group>
</group>
                      

 <notebook>
    <page string="Semi-Finished Goods">
    <field name="fg_bom_line_ids" widget="one2many_list">
    <tree editable="bottom">
    <!-- Adjust field names based on your model -->
    <field name="sfg_bom_id"/>
    <field name="quantity" editable="top"/>
    <field name="unit_price" readonly="1" string="Price" widget="monetary"/>
    </tree>
    </field>
    <group colspan="2"
    class="oe_subtotal_footer oe_right">

    <label for="sfg_cost"/>
    <field name="sfg_cost" nolabel="1"
    sum="Total amount" widget="monetary"/>
    </group>
    </page>
    <page name="Components" string="Materials">
    <field name="sfg_bom_line_ids" widget="one2many_list">

    <tree string="Tree View Title" editable="bottom">
    <field name="primary_component_id"/>
    <field name="quantity"/> 
    <field name="unit_price" widget="monetary"/>
    <field name="total_cost" readonly="1" widget="monetary"/>

    </tree>
    </field>
    <group colspan="2"
    class="oe_subtotal_footer oe_right">

    <field name="component_cost" 
    sum="Total amount" widget="monetary"/>
    </group>
    </page>
    <page name="Miscellaneous" string="Miscellaneous">
    
        <field name="miscellaneous_ids" widget="one2many_list">

    <tree string="Tree View Title" editable="bottom">
    <field name="name"/>
    <field name="description"/> 
    <field name="cost" widget="monetary"/>

    </tree>
    </field>
    <group colspan="2"
    class="oe_subtotal_footer oe_right">

    <field name="miscellaneous_cost" 
    sum="Total amount" widget="monetary"/>
    </group>
    </page>

</notebook>

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

              <menuitem id="fg_bom_menu"
              name="FG BOM"
              parent="bom_menu_root"
              action="action_fg_bom_list"  sequence="3"/>
              
</odoo>
