<?xml version="1.0" ?>
<openerp>
    <data>

        <record id="view_open_questionnaire_form" model="ir.ui.view">
            <field name="name">Open Questionnaires</field>
            <field name="model">open.questionnaire</field>
            <field name="arch" type="xml">
                <form string="Questionnaires" version="7.0">
                    <group>
                        <field name="questionnaire_id"/>
                    </group>
                    <footer>
                        <button name="build_form" string="Open Questionnaire" type="object" class="oe_highlight"/>
                        or
                        <button string="Cancel" class="oe_link" special="cancel" />
                    </footer>
                </form>
            </field>
        </record>

        <record model="ir.actions.act_window" id="action_open_questionnaire">
            <field name="name">Open Questionnaire</field>
            <field name="res_model">open.questionnaire</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="view_id" ref="view_open_questionnaire_form"/>
            <field name="target">new</field>
        </record>

        <record id="open_questionnaire_form" model="ir.ui.view">
            <field name="name">open.questionnaire.form</field>
            <field name="model">open.questionnaire</field>
            <field name="arch" type="xml">
                <form string="Open Questionnaire" version="7.0">
                    <separator colspan="4" string="Questionnaire"/>
                    <field name="question_ans_ids" colspan="4" nolabel="1" mode="tree" width="550" height="200"/>
                    <footer>
                        <button name="questionnaire_compute" string="Save Data" type="object" class="oe_highlight"/>
                        or
                        <button string="Cancel" class="oe_link" special="cancel" />
                    </footer>
                </form>
            </field>
        </record>

        <record id="view_open_questionnaire_line_tree" model="ir.ui.view">
            <field name="name">open.questionnaire.line.list</field>
            <field name="model">open.questionnaire.line</field>
            <field name="arch" type="xml">
                <tree editable="bottom" string="Questionnaire">
                    <field name="question_id"/>
                    <field name="answer_id" domain="[('question_id', '=', question_id)]"/>
                </tree>
            </field>
        </record>

        <record id="view_open_questionnaire_line_form" model="ir.ui.view">
            <field name="name">open.questionnaire.line.form</field>
            <field name="model">open.questionnaire.line</field>
            <field name="arch" type="xml">
                <form string="Questionnaire" version="7.0">
                    <field name="question_id"/>
                    <field name="answer_id" domain="[('question_id', '=', question_id)]"/>
                </form>
            </field>
        </record>

        <!-- Questionnaire form view -->
        <!--<act_window
            context="{}"
            id="act_open_questionnaire"
            name="Using a Questionnaire"
            res_model="open.questionnaire"
            src_model="crm_profiling.questionnaire"
            view_id="view_open_questionnaire_form"
            target="new"
            view_mode="form"/>-->

    </data>
</openerp>
