Odoo Help

0
1
Manoj
On 7/4/14, 8:19 AM

first of all you havre to create the form view like below....        

<record id="myfirst_form_view" model="ir.ui.view">
            <field name="name">scholar.details.form</field>
            <field name="model">scholar.details</field> ------>this is the model name(class name)
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="student.details" version="7.0">
                    <sheet string="student">
                        <h1>
                            <label string="Add Scholar Details"/>
                        </h1>
                        <group string="My First Form View">
                            <field name="name"/>
                            <field name="age"/>
                            <field name="dob"/>
                            <field name="stream_id"/>
                            <field name="status"/>
                        </group>
                        <field name="subject_id"/>
                    </sheet>
                </form>
            </field>
        </record>

then you have to create action view like...

        <record id="action_scholar_details" model="ir.actions.act_window">
            <field name="name">My First Action</field>
            <field name="res_model">scholar.details</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field> ----> here we provide for both tree and form view , while tree view will come erlier
            <field name="help" type="html">
                <p class="oe_view_nocontent_create">
                    test
                </p><p>
                    Description goes Here.
                </p>
            </field>
        </record>

and finally you have to create the menu item like..

        <menuitem id="menu_base_scholar" name="Scholar"/>
        <menuitem id="menu_section_scholar" parent="menu_base_scholar" name="Scholar_Record"/>
        <menuitem id="menu_item_scholar" parent="menu_section_scholar" name="Record Codes" action="action_scholar_details"/>

 

if this will work then its fine else you have to create and add tree view also (you can add this one before or after the form view)

        <record id="myfirst_tree_view" model="ir.ui.view">
            <field name="name">scholar.details.tree</field>
            <field name="model">scholar.details</field>
            <field name="arch" type="xml">
                <tree string="My First Tree View">
                    <field name="name"/>
                    <field name="age"/>
                    <field name="dob"/>
                    <field name="subject_id"/>
                    <field name="stream_id"/>
                    <field name="status"/>
                </tree>
            </field>
        </record>

I think this will surely help you in creating your own view.

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)

Stats

Asked: 7/4/14, 7:57 AM
Seen: 6304 times
Last updated: 8/10/18, 7:04 AM