<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- Tree View -->
    <record id="view_saas_plan_tree" model="ir.ui.view">
        <field name="name">saas.plan.tree</field>
        <field name="model">saas.plan</field>
        <field name="arch" type="xml">
            <tree string="SaaS Plans">
                <field name="name"/>
                <field name="max_pos"/>
                <field name="max_users"/>
                <field name="price_monthly"/>
                <field name="price_yearly"/>
                <field name="active"/>
            </tree>
        </field>
    </record>

    <!-- Form View -->
    <record id="view_saas_plan_form" model="ir.ui.view">
        <field name="name">saas.plan.form</field>
        <field name="model">saas.plan</field>
        <field name="arch" type="xml">
            <form string="SaaS Plan">
                <sheet>
                    <div class="oe_title">
                        <label for="name" class="oe_edit_only"/>
                        <h1>
                            <field name="name" placeholder="e.g. Starter"/>
                        </h1>
                    </div>
                    <group>
                        <group string="Limits">
                            <field name="max_pos"/>
                            <field name="max_users"/>
                        </group>
                        <group string="Pricing">
                            <field name="price_monthly" widget="monetary"/>
                            <field name="price_yearly" widget="monetary"/>
                            <field name="active"/>
                        </group>
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <!-- Action -->
    <record id="action_saas_plan" model="ir.actions.act_window">
        <field name="name">Subscription Plans</field>
        <field name="res_model">saas.plan</field>
        <field name="view_mode">tree,form</field>
    </record>

    <!-- Menuitem -->
    <menuitem id="menu_saas_plan"
              name="Subscription Plans"
              parent="menu_saas_configuration"
              action="action_saas_plan"
              sequence="10"/>
</odoo>
