<?xml version="1.0" encoding="utf-8"?>
<terp>
    <data>
        
        <menuitem icon="STOCK_PREFERENCES" id="menu_tools" name="Tools"/>
        <menuitem id="next_id_45" name="Subscriptions" parent="subscription.menu_tools"/><menuitem groups="base.group_admin" id="menu_subscription_config" name="Configuration" parent="next_id_45"/>
        <!--
	=======================================================
	Subscription Views
	=======================================================
	-->
        <record id="view_subscription_form" model="ir.ui.view">
            <field name="name">subscription.subscription.form</field>
            <field name="model">subscription.subscription</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Subscriptions">
                    <notebook>
                        <page string="Subsription Data">
                            <field name="name" select="1"/>
                            <field name="active" select="1"/>
                            <field name="user_id" select="1"/>
                            <field name="partner_id" select="1"/>
                            <newline/>
                            <field name="interval_number"/>
                            <field name="interval_type"/>
                            <field name="exec_init"/>
                            <field name="date_init"/>
                            <field colspan="4" name="doc_source" widget="reference"/>
                            <field colspan="4" name="notes"/>
                            <separator colspan="4"/>
                            <field colspan="4" name="cron_id" readonly="1"/>
                            <field name="state" readonly="1"/>
                            <group col="3" colspan="2">
                                <button name="set_process" states="draft" string="Process" type="object"/>
                                <button name="set_done" states="running" string="Stop" type="object"/>
                                <button name="set_draft" states="done" string="Set to Draft" type="object"/>
                            </group>
                        </page>
                        <page string="Documents created">
                            <field colspan="4" name="doc_lines" nolabel="1" widget="one2many_list"/>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>
        
        <record id="view_subscription_tree" model="ir.ui.view">
            <field name="name">subscription.subscription.tree</field>
            <field name="model">subscription.subscription</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Subscriptions">
                    <field name="name"/>
                    <field name="active"/>
                    <field name="user_id"/>
                    <field name="partner_id"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>
        
        <record id="action_subscription_form" model="ir.actions.act_window">
            <field name="name">All Subscriptions</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">subscription.subscription</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="view_subscription_tree"/>
        </record>
        <menuitem action="action_subscription_form" id="menu_action_subscription_form" parent="subscription.next_id_45"/>
        
        <record id="subscription_subscription_history_tree" model="ir.ui.view">
            <field name="name">subscription.subscription.history.tree</field>
            <field name="model">subscription.subscription.history</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Subscription History">
                    <field name="date"/>
                </tree>
            </field>
        </record>
        
        <record id="subscription_subscription_history_form" model="ir.ui.view">
            <field name="name">subscription.subscription.history.form</field>
            <field name="model">subscription.subscription.history</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Subscription History">
                    <field name="date"/>
                    <field colspan="4" name="document_id"/>
                </form>
            </field>
        </record>
        
        <record id="document_form" model="ir.ui.view">
            <field name="name">subscription.document.form</field>
            <field name="model">subscription.document</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Subscription Document">
                    <field name="name" select="1"/>
                    <field name="active" select="1"/>
                    <field name="model" select="1"/>
                    <field colspan="4" name="field_ids" nolabel="1"/>
                </form>
            </field>
        </record>
        
        <record id="document_tree" model="ir.ui.view">
            <field name="name">subscription.document.tree</field>
            <field name="model">subscription.document</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Subscription Document">
                    <field name="name"/>
                    <field name="active"/>
                    <field name="model"/>
                </tree>
            </field>
        </record>
        
        <record id="document_fields_form" model="ir.ui.view">
            <field name="name">subscription.document.fields.form</field>
            <field name="model">subscription.document.fields</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Subscription Document Fields">
                    <field name="field" select="1"/>
                    <field name="value"/>
                </form>
            </field>
        </record>
        
        <record id="document_fields_tree" model="ir.ui.view">
            <field name="name">subscription.document.fields.tree</field>
            <field name="model">subscription.document.fields</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Subscription Document Fields">
                    <field name="field"/>
                    <field name="value"/>
                </tree>
            </field>
        </record>
        
        <record id="action_document_form" model="ir.actions.act_window">
            <field name="name">Document Types</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">subscription.document</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="document_tree"/>
        </record>
        <menuitem action="action_document_form" id="menu_action_document_form" parent="subscription.menu_subscription_config"/>
    </data>
</terp>