Thursday, 21 June 2012
Thursday, 3 May 2012
OpenERP Security issue
OpenERP Security its too cool..
Security is the main issue in any organization or firm because without it, its became handicapped . So, its needed in OpenERP to define security means access rules as well as access rights that will restrict the user to use particular.
Here i described one security file that will describe the groups.
I hope its useful to you all.
Security and implies_ids
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="base.group_library_user" model="res.groups">
<field name="name">Library User</field>
</record>
<record id="base.group_library_
<field name="name">Librarian</field>
</record>
<record id="base.group_lib_resuser_
<field name="name">Employees</field>
<field name="category_id" ref="base.module_category_
<field name="implied_ids" eval="[(4, ref('base.group_library_user')
</record>
</data>
</openerp>
...Enjoy...
Auto Number Generate in OpenERP
Auto Number Generate in OpenERP
Simply just create a new file .xml
lib.resource = table name
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<!-- Sequences for lib.resource -->
<record id="seq_type_library_sub_ resource" model="ir.sequence.type">
<field name="name">Library Resource</field>
<field name="code">lib.sub.resource</ field>
</record>
<record id="seq_library_sub_resource" model="ir.sequence">
<field name="name">Library Resource</field>
<field name="code">lib.sub.resource</ field>
<field name="prefix">BC</field>
<field name="padding">10</field>
</record>
</data>
</openerp>
Or
simply write below code in your view.xml file
<record id="seq_type_library_sub_ resource" model="ir.sequence.type">
<field name="name">Library Resource</field>
<field name="code">lib.sub.resource</ field>
</record>
<record id="seq_library_sub_resource" model="ir.sequence">
<field name="name">Library Resource</field>
<field name="code">lib.sub.resource</ field>
<field name="prefix">BC</field>
<field name="padding">10</field>
</record>
and in your .py file in _default simply write the below code
_defaults :
{
'number': lambda obj, cr, uid, context: obj.pool.get('ir.sequence'). get(cr, uid, 'lib.resource'),
}
Simply just create a new file .xml
lib.resource = table name
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<!-- Sequences for lib.resource -->
<record id="seq_type_library_sub_
<field name="name">Library Resource</field>
<field name="code">lib.sub.resource</
</record>
<record id="seq_library_sub_resource" model="ir.sequence">
<field name="name">Library Resource</field>
<field name="code">lib.sub.resource</
<field name="prefix">BC</field>
<field name="padding">10</field>
</record>
</data>
</openerp>
Or
simply write below code in your view.xml file
<record id="seq_type_library_sub_
<field name="name">Library Resource</field>
<field name="code">lib.sub.resource</
</record>
<record id="seq_library_sub_resource" model="ir.sequence">
<field name="name">Library Resource</field>
<field name="code">lib.sub.resource</
<field name="prefix">BC</field>
<field name="padding">10</field>
</record>
and in your .py file in _default simply write the below code
_defaults :
{
'number': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').
}
Install Eclipse for OpeERP
OpenERP : 6.1
Postgresql : 9.1
Eclispe : latest in ubuntu repository
Postgresql : 9.1
Eclispe : latest in ubuntu repository
Run the following commands from the terminal.
1) Installs eclipse and its dependencies.
sudo apt-get update
sudo apt-get install eclipse
2)Installs python and its libraries packages required for openerp-server
sudo apt-get install python python-psycopg2 python-reportlab python-pychart python-pydot
python-egenix-mxdatetime python-lxml python-libxslt1 python-tz python-dateutil python-vobject
python-mako python-yaml python-dev python-setuptools python-pybabel
sudo apt-get update
sudo apt-get install eclipse
2)Installs python and its libraries packages required for openerp-server
sudo apt-get install python python-psycopg2 python-reportlab python-pychart python-pydot
python-egenix-mxdatetime python-lxml python-libxslt1 python-tz python-dateutil python-vobject
python-mako python-yaml python-dev python-setuptools python-pybabel
3)OpenerpERP server uses postgresql database server for its working so,
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.1 postgresql-client-9.1 postgresql-contrib-9.1
4)Create a database user for OpenERP in postgresql server, who can create databases and manipulate them.
sudo su postgres
createuser <system-user-name> (enter "y" when prompted for super user role)
exit
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.1 postgresql-client-9.1 postgresql-contrib-9.1
4)Create a database user for OpenERP in postgresql server, who can create databases and manipulate them.
sudo su postgres
createuser <system-user-name> (enter "y" when prompted for super user role)
exit
5)Openerp-server 6.1 requires Werkzeug and Python-openid packages to be installed.
wget http://pypi.python.org/packages/source/W/Werkzeug/
Werkzeug-0.8.3.tar.gz#md5=12aa03e302ce49da98703938f257347a (copy the full link)
tar -zxvf Werkzeug-0.8.3.tar.gz
cd Werkzeug-0.8.3
python setup.py install
cd ..
wget http://pypi.python.org/packages/source/W/Werkzeug/
Werkzeug-0.8.3.tar.gz#md5=12aa03e302ce49da98703938f257347a (copy the full link)
tar -zxvf Werkzeug-0.8.3.tar.gz
cd Werkzeug-0.8.3
python setup.py install
cd ..
wget http://pypi.python.org/packages/source/p/python-openid/
python-openid-2.2.5.tar.gz#md5=393f48b162ec29c3de9e2973548ea50d (copy the full link)
tar -zxvf python-openid/python-openid-2.2.5.tar.gz
cd python-openid-2.2.5
python setup.py install
cd ..
python-openid-2.2.5.tar.gz#md5=393f48b162ec29c3de9e2973548ea50d (copy the full link)
tar -zxvf python-openid/python-openid-2.2.5.tar.gz
cd python-openid-2.2.5
python setup.py install
cd ..
6) Install PyDev plugin in eclipse
a)help -> Install New Software.
b)In Install dialog box, Click Add.
c)Give name ‘pydev’ and type the path. i.e.
d)click ok.
e)select pydev checkbox and follow the steps by clicking finish
a)help -> Install New Software.
b)In Install dialog box, Click Add.
c)Give name ‘pydev’ and type the path. i.e.
d)click ok.
e)select pydev checkbox and follow the steps by clicking finish
7)Adding python in eclipse can be done by
a)window -> Preferences
b)In Preferences dialog box expand pydev from left side tree
c)click on Interpreter-Python
d)click new (python interpreter)
e)browse and select "File System-->usr-->bin-->python" and also give name "python2.6"
f) click ok then again ok
a)window -> Preferences
b)In Preferences dialog box expand pydev from left side tree
c)click on Interpreter-Python
d)click new (python interpreter)
e)browse and select "File System-->usr-->bin-->python" and also give name "python2.6"
f) click ok then again ok
8)Download Openerp 6.1 source tarball from,
http://nightly.openerp.com/6.1/releases/openerp-6.1-1.tar.gz
http://nightly.openerp.com/6.1/releases/openerp-6.1-1.tar.gz
9)Extract the tarball downloaded and create a folder Openerp and move the tarball and extract it there, rename it
toOpenerp-6.1
10)Switch the workspace folder to created Openerp folder and create a new Pydev project in eclipse named Openerp-6.1.
New-> project --> Pydev --> Pydev project
project name - Openerp-6.1
check Use default
Press F5 after creating the project to refresh the workspace.
New-> project --> Pydev --> Pydev project
project name - Openerp-6.1
check Use default
Press F5 after creating the project to refresh the workspace.
11)In Eclipse package explorer, Rename openerp-server in Openerp-6.1 folder to openerp-server.py.
Right Click on, openerp-server.py --> Run as --> Python run.
Right Click on, openerp-server.py --> Run as --> Python run.
Openerp web can be accessed from the browser through browser http://localhost:8069.
Hope this blog might be helpful.
Thanks ,
Pinakin Nayi
OpenERP , Gandhinagar.
nayi.pinakin@gmail.com
OpenERP , Gandhinagar.
nayi.pinakin@gmail.com
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 from Click Me!!! To Download
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 from Click 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
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
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
Subscribe to:
Posts (Atom)