Wednesday, 17 September 2014

Step by step. Setup Odoo v8 Developement Envirnment in Ubuntu systsem.


Here this blog will help  you to setup odoo 8 step by step.

1) In very first step you need to install git. into your Linux system.

     sudo apt-get install git

2) Download the source code from git repository

    git clone --branch 8.0 https://github.com/odoo/odoo  

3) Install all required libraries used in odoo 8 addons module, just copy and   p aste these mention libraries into your terminal
 
sudo apt-get install python-dateutil python-docutils python-feedparser python-gdata python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-psycopg2 python-psutil python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-psutil python-requests


3) Download the eclipse from below link.

    32 Bit
  
    64 Bit


4) Setup pyDev plug in on eclipse.



5) Create New Project Select General category. You will provide the name of your odoo source code which is already in your workspace and than press next button than your source code will appear on eclipse screen.


Now you can do your changes.


This blog is not completed yet will update soon!!  


How to create Module in Odoo v8 step by step.

Here is the module structure

odoov8_demo (Module Name)

---- __init__.py
---- __openerp__.py
---- description (Folder)
-------static (Folder)
----------description (Folder)
--------------icon.png
--------------index.html
---- test.py
---- test_view.xml


 1) __init__.py (File)

  Description : You need to import all the .py file inside.


 Example :

  import test


2) __openerp__.py (File)

Syntax : 

{
    'name' : 'Module Name',
    'version' : '1.0',
    'author' : '<Author Name>',
    'category' : <Module Category>,
    'description' : """
        <Module Description>
    """,
    'website': <website link>,
    'depends' : <list of modules for dependency>,
    'data': <List of XML, CSV files to be imported>,
    'installable': <boolean>,
    'auto_install': <boolean>
,
}



Example :


{
    'name' : Odoo Testing Module',
    'version' : '1.0',
    'author' : 'openerpguru',
    'category' : "Testing",
    'description' : """
        This module is only for your learning purpose.
    """,
    'website': http://www.google.com,
    'depends' : ['base'],
    'data': ['test_view.xml'],
    'installable': True,
    'auto_install': False
,
}


3) test.py (File)

Example :

from openerp import models, fields, api


class test_test(models.Model):
 

    _name = test.test'
   
    _order = 'name'
   
    _rec_name = 'fname'
   
    name = fields.Char('First Name', size=64)
    lname = fields.Char('Last Name', size=64)
    email = fields.Char('Email')
    dob = fields.Date('Date of Birth', copy=False)



4) test_view.xml  (File)

<!-- Form View -->
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="test_test_form_view" model="ir.ui.view">
            <field name="name">test.test.form.view</field>
            <field name="model">test.test</field>
            <field name="arch" type="xml">
                <form>
                    <sheet version="8.0">
                        <group colspan="4" col="4">
                            <field name="fname" />
                            <field name="lname" />
                            <field name="email" />
                            <field name="dob" />
                        </group>
                    </sheet>
                </form>
              </field>
        </record>


         <!-- Tree View -->
         <record id="test_test_tree_view" model="ir.ui.view">
            <field name="name">test.test.tree.view</field>
            <field name="model">test.test</field>
            <field name="arch" type="xml">
                <tree>
                   
<field name="fname" />
                    <field name="lname" />
                    <field name="email" />
                    <field name="dob" />

                </tree>
           </field>
        </record>



       
       <!-- Action -->        
         <record id="action_testing_tree_view" model="ir.actions.act_window">
            <field name="name">Testing Information</field>
            <field name="res_model">test.test</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>
        

       <!-- Menu Items -->
        <menuitem id="test_main_menu_id" name="Sample Testing"/>
        <menuitem id="test_test_categ_id" parent="
test_main_menu_id" name="Testing"/>
        <menuitem id="testing
_info_id" parent="test_test_categ_id" action="action_testing_tree_view" name="Testing Information"/>
        


5) index.html

   Write your html code for customize your module description


6) icon.png

    this file will set the icon on the module. when you search for your module from module list it will display with this icon.


Hope these steps will helps you to create sample module with openerp version 8 standard. more will update soon on this blog.