<odoo>
    <!-- Recipe Form View -->
    <record id="view_dine360_recipe_form" model="ir.ui.view">
        <field name="name">dine360.recipe.form</field>
        <field name="model">dine360.recipe</field>
        <field name="arch" type="xml">
            <form string="Dish Recipe">
                <sheet>
                    <group>
                        <group>
                            <field name="product_tmpl_id" options="{'no_create': True}"/>
                        </group>
                        <group>
                            <field name="total_cost" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Ingredients" name="ingredients">
                            <field name="ingredient_ids">
                                <tree editable="bottom">
                                    <field name="product_id" options="{'no_create': True}"/>
                                    <field name="quantity"/>
                                    <field name="uom_id"/>
                                    <field name="cost_price" widget="monetary"/>
                                    <field name="subtotal_cost" widget="monetary"/>
                                </tree>
                            </field>
                        </page>
                    </notebook>
                </sheet>
            </form>
        </field>
    </record>

    <!-- Recipe Tree View -->
    <record id="view_dine360_recipe_tree" model="ir.ui.view">
        <field name="name">dine360.recipe.tree</field>
        <field name="model">dine360.recipe</field>
        <field name="arch" type="xml">
            <tree string="Dish Recipes">
                <field name="product_tmpl_id"/>
                <field name="total_cost" widget="monetary"/>
            </tree>
        </field>
    </record>

    <!-- Recipe Action -->
    <record id="action_dine360_recipe" model="ir.actions.act_window">
        <field name="name">Dish Recipes</field>
        <field name="res_model">dine360.recipe</field>
        <field name="view_mode">tree,form</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Create your first Recipe!
            </p>
            <p>
                Define the ingredients used for each dish to track inventory and margins.
            </p>
        </field>
    </record>

    <!-- Menuitem (Inside Dine360 Dashboard or Restaurant) -->
    <menuitem id="menu_dine360_recipe_root"
              name="Recipes"
              parent="point_of_sale.menu_point_root"
              sequence="25"/>

    <menuitem id="menu_dine360_recipe"
              name="Dish Recipes (BOM)"
              parent="menu_dine360_recipe_root"
              action="action_dine360_recipe"
              sequence="10"/>

</odoo>
