This question has been flagged
1 Reply
3149 Views

Hi I am new to OpenERP... Iam confused how a module works. I got a sample module code from google. The code is as follows:

student.py:(Python module file)

from osv import osv,fields
class student_info(osv.osv):
_name = 'student.info'
_columns = {
    'name' : fields.char('Name', size=20, required=True),
    'phNo' : fields.integer('Ph No:', required=True)
    }
student_info()

XML File:

    <!-- Tree View Operation Starts -->
        <record id="student_info_tree" model="ir.ui.view">
            <field name="name">student.result.tree</field>
            <field name="model">student.info</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="student_result">
                    <field name="name" />
                    <field name="phNo" />
                </tree>
            </field>                
        </record>
    <!-- Tree View Operation Ends -->

    <!-- Form View Operation Starts -->
        <record id="student_info_form" model="ir.ui.view">
            <field name="name">student.result.form</field>
            <field name="model">student.info</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="General Information">
                    <field name="name"/>
                    <field name="phNo"/>
                </form>
            </field>                
        </record>
    <!-- Form View Operation Ends -->


    <!-- Action Operation Starts -->
        <record id="action_student_info_form" model="ir.actions.act_window">
            <field name="name">General Information</field>
            <field name="res_model">student.info</field>
            <field name="view_type">form</field>
            <field name="view_mode">form,tree</field>
        </record>
    <!-- Action Operation Ends -->

    <!-- Menu Operation Starts -->
        <menuitem id="student_parent" name="student" icon="terp-partner"/>
        <menuitem id="menu_student_parent" name="General Information Management" parent="student_parent"></menuitem>
        <menuitem action="action_student_info_form" id="menu_student_info" parent="menu_student_parent" string="Result"/>
    <!-- Menu Operation Ends -->

When I run this code its working fine. Insert and List operations are working fine. In this code their is no select nor insert query but both operations are taking place. Can any one help me to understand how this works??? Thanks in advance for your valuable answers...

Avatar
Discard
Best Answer

Hi,

the OpenObject framwork of openerp make all the operations.

you can start in OpenERP with How i can create module openerp 7 ?

Avatar
Discard
Author

Thanks alot for your help Borni:)

Can you mark your question as solved, and mark the correct answer