Showing posts with label OpenERP. Show all posts
Showing posts with label OpenERP. Show all posts

Thursday 3 May 2012

Jasper Report in OpenERP

Hello Friends ,
     You all about to search "How to create Report attractive in OpenERP" or "How to vreate Jasper Report in OpenERP".
I hope this blog will helpful to you all.

Step 1 : 
                    Download  (jasper_reports.zip (40mb))
                    also download from  http://apps.openerp.com/addon/get_module_as_zip/6987/jasper_reports.zip
Step 2 :
                   To install this module you have to unzip the jasper_reports.zip because of the size of the module( approx.  
                   50Mb) 
                   it is difficult to import this zip file. 
                   So unzip the module to your openerp addons folder, then restart the server and update the module
                   list,
                   install the jasper report module.Thats it!!

Step 3 : 
                  Download ireport froClick Me!!! To Download
Step 4 :
                 Install Jasper Report in Your OpenERP.
Step 5 :  
                 create Data Template from
                ->setting > customization > jasper > jasper data template
                















               


To Display image in openerp Report

                                                                                                              Pinakin Nayi
                                                                                                              OpenERP,
                                                                                                              Info-city, Gandhinagar.
                                                                                                              nayi_pinakin@yahoo.in
                                                                                                              Mo. 08460643746
To Display Image in your .rml Report in OpenERP
in .rml file
<para>[[ images['image'] and setTag('para','image') or removeParentNode('para') ]][[ images['preview'] ]]</para>
in the report.py
def _get_imagepath(self,order):
        attach_ids = self.pool.get('product.images').search(self.cr, self.uid, [('product_id', '=',order)])
        datas = self.pool.get('product.images').read(self.cr, self.uid, attach_ids)
        return datas

Monday 23 April 2012

OpenERP Barcode Generate

Use Barcode in OpenERP report.

paste the folowing code in .rml file instead of barcode
<barCode code="code128" quiet="9" fontName="Times-Roman" fontSize="50" alignment="CENTER"> [[ tracking_ids.serial or '' ]] </barCode>

Friday 20 April 2012

How to create Scheduler in OpenERP

How to create Scheduler in  OpenERP . ( ir.cron )
                                                                                                        Nayi Pinakin
                                                                                                        Trainee OpenERP ,
                                                                                                        Gandhinagar . (Jan 2012 )
                                                                                                        nayi_pinakin@yahoo.in
Here are Steps you have to follow :

Step 1 :
          In view file simply write as under
          <record model="ir.cron" id="resource_panelty_cron">
            <field name="name">Resource Panelty Count</field>
            <field name="interval_number">1</field>
            <field name="interval_type">minute</field>
            <field name="numbercall">-1</field>
            <field eval="False" name="doall"/>
            <field eval="'lib.register'" name="model"/>
            <field eval="'compute_penalty'" name="function"/>  # call the function in .py file
            <field eval="'()'" name="args"/>
        </record>

Step 2 :
        you can also directly create your Scheduler :
         like ,
         1.       First you simply go setting - > configuration -> scheduler -> scheduler_action



      2.  Now create new Scheduler  here interval number and interval unit important



   3.  Now , in object simply write your table name and in Method write your .py file method 
        which you want to call at every repeated time.


       

 Description : 


"scheduler_id" : is a unique xml record id
"scheduler_name" : any desirable name
"active" :  True or False determines whether the scheduler is active or not..
"user_id" : refers the user who owns the scheduler
"interval_number" : number of times the scheduler is to be called based on the "interval_type"

"interval_type" 
: it can be days, hours, minututes etc
"numbercall" : Number of time the function is called. negative number indicates no limit
"doall" : booelan field. A 'True' enables it to execute missed occurences as soon as the server is restarts

 "model" : Name of object whose function will be called when this scheduler will run. e.g. 'res.partener'
"function" : Name of the method to be called on the object when this scheduler is executed.
 "args" : Arguments to be passed to the method. e.g. (uid,)

 
        

Thursday 19 April 2012

How to Add custom Widget in your open ERP module

How to Add custom Widget in your open ERP module ..
 Here are steps : 
                                                        By : Pinakin Nayi
                                                               Trainee OpenERP,
                                                               Gandhinagar.
                                                               E-mail : nayi_pinakin@yahoo.in
Step 1 :
          create a folder
                   --> static
                            --> src
                                   -->js
                                        ->lib.js
                                  --> xml
                                        -> lib.xml
                                  --> css
                                        -> .css

Step 2 :
          Register your xml file in __openerp__.py
          Like this
                      'css': [ 'static/src/css/resource.css' ],
                      'js': [  'static/src/js/lib.js' ],
                       'qweb' : [ 'static/src/xml/lib.xml', ],

Step 3 : 
        In  "lib.xml"  create your template
           like ,
                    <templates id="template" xml:space="preserve">
                     <t t-name="link">
                      <div>manage your template  </div>
                    </t>
                  </templates>

Step 4 :
      In  "lib.js"  create your template
           like ,

                      openerp.lib = function(instance)
                     {
                       console.log('tTTT',instance)
                       instance.web.form.widgets.add('link', 'openerp.lib.Mywidget');
                       instance.lib.Mywidget = instance.web.form.Widget.extend( {
                              template : 'link',
                              init : function(arg)
                                             {
                              console.log('initi....my custome widget');
                              }
                      })
                  }

Step 5 : 
       In this test i have only write "manage your template" instread of that you can
      write your own template to implement ..

Step 6 : 
         Now , your Widget is ready ,
         you have to implement this in your tag.

        <field name="description" colspan="4" widget="link" />


OpenERP Create Web Module


OpenERP Create Web Module

                                                                    By : Pinakin Nayi
                                                                           Trainee OpenERP (Jan 2012) ,
                                                                           Gandhinagar .
                                                                           nayi_pinakin@yahoo.in


Hello ,
        You all are going to search "OpenERP Web Module". I hope this will helpful to you.
OpenERP Web Module.

--> To build web module you have to create a module at server addons.

--> You need to first create
                  __init__.py and
                  __openerp__.py file similar as server addons.
Where
 __openerp__.py have more parameters likes
{

“name”: “lib_resource”,
“category” : “Hidden”,
“description”:’Openerp web Library’,
“version”: “2.0″,

“depends”: ['web','project'],
qweb’ : ['static/src/xml/lib.xml'],
“css”: [],
“js”: ['static/src/js/lib.js'],
“auto_install”: True
}

--> As you see in above code. how to add your css and js and qweb templates.

        Inside your module need to manage folder structure.
       
        lib_resource/static/src/xml   ->  Files related to qweb templates
       
        lib_resourcer/static/src/js     ->  Files related to javascript which you create or code.
       
        lib_resource/static/lib          ->  Put your javascript related libs and js plugins….

__openerp__.py
__init__.py

*--> Create
        lib.js file at lib_resource/static/src/js.

        Note : Now most important rule to remember. inside lib.js you need to create openerp new namespace lib_resource.
       
        openerp.lib_resource = function(openerp)
        {
            var myTemplate  =  ’link’,   // template for qweb rendering … we can manage it as per our requirement.
            Here you can create new function or global variables.
            Also if you want to modify or inherit any existing class or libs the  here you can manage that.
            Here you can inherit any existing class and modify its operation and also able to create new classes…
        }

--> lib.xml  [ at ] lib_resource/static/src/xml

 This file holds information regarding qweb template’s.
What is qweb???
when we try to load the page then templates render on qweb.js and qweb2.js
these 2 files are containing all the information well i also do not know deeply about this because we have never try to know that thing.
meanly it is used for loading the templates for different views
 example :
   
    <?xml version=”1.0″ encoding=”UTF-8″?>
   
    <templates id=”link1” xml:space=”preserve”>   
        <t t-name=”link”>
            <div>………………… manage your template……………    </div>
        </t>   
    </templates>

--> OpenERP Web Module { Level 2 } :
   
    If you want to create new  widget for form.
   
    openerp.lib = function(openerp)
    {
        openerp.web.form.<class name> = openerp.web.form.<class name>.extend({
            ….. manage your code …..
        });
    }

For getting more grips on it review all most web addons in side server addons folders.

Note : ( Remember )
    OpenERP have main important files are located at :
    -->addons/web/static/src/js :-
        Here all js are main core js and on this other openerp javascript depended.
       
        boot.js, core.js, crome.js and data.js files are the heart of openerp framework.
        Where view_form.js, view_page.js and view_list.js are also most important to render list view and form views.
        Also all other files in this same directory are most important files.
       
        OpenERP have user jqeury differed all most in code. So need to grip on it too.
       
        addons/web/static/src/xml :- base.xml

------>>>>
This file hold all most all presentation view related templates.