Sunday 7 July 2013

OpenERP Change Port , OpenERP Host Multiple Instances on single server


If you want to host multiple instances of OpenERP on a single server then follow the following steps (I ASSUME THAT YOU ARE RUNNING ONE INSTANCE OF OPENERP AND HAVE THE INSTALLATION COMPLETED ) 

  1. Just create a new user name and group of the system for the sake of convenience and less chance of missing any feature by the following command

adduser --system --home=/opt/openerpins2 --group openerpins2


2.      Create a new user for postgresql so that the databases from the other instance not pops on the other instance by the following command

su – postgres  --- this will log you to the postgres

createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt openerpins2   ----- this will create a new user in the postgres

3.  Then in the next step go to the bash of the new system user say openerpins2 with the following command
     
su – openerpins2 -s /bin/bash
Don’t panic if this does not logs you to the / opt/openerpins2 folder if it does not manually go to the folder copy and extract a fresh copy of OpenERP 6.1 server
tar –cvf openerp6.1.tar
4.      Then assign a ownership of the openerpins2 folder to new user openerpins2

chown -R openerpins2: *

5.  Then change the following lines in the server part
1.  /opt/openerpins2/server/openerp/service/ netrpc_server.py
The last line of the file as “int(tools.config.get('netrpc_port', 8070)))” to “int(tools.config.get('netrpc_port', 8050)))”

2.  And in /opt/openerpins2/server/openerp/tools/ config.py
1.  group.add_option("--xmlrpc-port", dest="xmlrpc_port", my_default=8069,------- to ---------- group.add_option("--xmlrpc-port", dest="xmlrpc_port", my_default=8059,
2.  group.add_option("--xmlrpcs-port", dest="xmlrpcs_port", my_default=8071,  ----- to ---- group.add_option("--xmlrpcs-port", dest="xmlrpcs_port", my_default=8061,
3.  group.add_option("--netrpc-port", dest="netrpc_port", my_default=8070, ----- TO ------ group.add_option("--netrpc-port", dest="netrpc_port", my_default=8060,

6.  Finally check the running version of the both by
1.  su – openerpins2 -s /bin/bash
/opt/openerp/server/openerp-server
This will show that openerp is running and waiting for connection


ENJOY>>>>>>>>>>

Friday 22 March 2013

QGIS LIBPQ.dll Error

If you find a error like LIBPQ.dll Not found in the Quantum GIS Lisboa

then you just have to search libpq.dll in the installed folder like in the program files usually and copy it and paste to


C:\Program Files\Quantum GIS Lisboa\apps\qgis\bin

and rename libpq.dll to LIBPQ.dll and start the QGIS it will start
 ENJOY.....


Thursday 7 February 2013

Install Quantum GIS Desktop Ubuntu 12.10

You can use ubuntugis ppa, which contains everything you need:

 $ sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
 $ sudo apt-get update
 $ sudo apt-get install qgis

The system will take after the necessary dependencies

Your problem also suggests that you have broken dependencies for qgis. One way to fix this is to clean your cache by running in terminal (you can open the terminal with alt + ctrl + T)

$ sudo apt-get clean

or

$ sudo apt-get autoclean

and then ask apt to try and correct any broken dependencies:

$ sudo apt-get -f install 

if the output is similar to :

$ 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

it means that you need some extra packages that you weren't informed about. To install them run:

$ sudo apt-get dist-upgrade

Tuesday 4 December 2012

Set the webclient hostname in openerp 6.1 all in one Win7 installation

In Version 6.0 I could find the hostname parameter for the webclient in the file "openerp-web.cfg". But in Version 6.1 the webclient is embed in the core and there is no "openerp-web.cfg".


openerp-server.conf

[options]
without_demo = False
smtp_port = 25
db_template = template0
db_password = XXXXXX
xmlrpcs = True
xmlrpcs_interface = 
syslog = False
logrotate = True
xmlrpcs_port = 8071
test_report_directory = False
list_db = True
timezone = False
xmlrpc_interface = 
test_file = False
cache_timeout = 100000
smtp_password = False
secure_pkey_file = server.pkey
xmlrpc_port = 8069
log_level = info
xmlrpc = True
test_disable = False
admin_passwd = XXXXX
assert_exit_level = error
smtp_server = localhost
static_http_url_prefix = None
unaccent = False
test_commit = False
proxy_mode = False
demo = {}
db_host = localhost
login_message = False
import_partial = 
pidfile = False
db_maxconn = 64
osv_memory_count_limit = False
reportgz = False
osv_memory_age_limit = 1.0
netrpc_port = 8070
db_port = 5432
virtual_memory_reset = 671088640
db_name = False
debug_mode = False
netrpc = True
secure_cert_file = server.cert
logfile = C:\Program Files (x86)\OpenERP 6.1-1\server\openerp-server.log
csv_internal_sep = ,
virtual_memory_limit = 805306368
pg_path = C:\Program Files (x86)\OpenERP 6.1-1\PostgreSQL\bin
static_http_enable = False
cpu_time_limit = 60
translate_modules = ['all']
smtp_ssl = False
server_wide_modules = None
netrpc_interface = 
smtp_user = False
log_handler = [':INFO']
db_user = XXXXX
dbfilter = .*
max_cron_threads = 4
email_from = False
addons_path = C:\Program Files (x86)\OpenERP 6.1-1\server\openerp\addons
static_http_document_root = None
 
 

Just Change the Following Things

 
xmlrpc_interface = my_ip
xmlrpc_port = my_port 
 

Thursday 11 October 2012

Change Views of OpenERP, Titles, Footer, Favicon





All web client customization is done on this directory
/usr/share/pyshared/openerp/addons/web/static/src

Below are the following files needed to be modified
---------------------------------------------------------------------------
base.css
/usr/share/pyshared/openerp/addons/web/static/src/css
Use to change color of the web frame. Use HTML notation when coding color. You can use GIMP to convert colors to HTML notation.

base.xml
/usr/share/pyshared/openerp/addons/web/static/src/xml
Use to change footer text "Powered by OpenERP". Leave this file unchanged to avoid violating the OpenERP AGPL license

chrome.js
/usr/share/pyshared/openerp/addons/web/static/src/js
Use to change the browser title and version as displayed on the footer beside the "Powered by.." statement
Look for this line document.title = title + sep + 'OpenERP' and replace it with document title of your choice. (i.e. document.title = "My OpenERP";)

favicon.ico
/usr/share/pyshared/openerp/addons/web/static/src/img
Use to change the default favicon displayed on the webpage
logo.png
/usr/share/pyshared/openerp/addons/web/static/src/img
The logo located at the right corner of the application
Size and aspect ratio should be preserved

logo2.png
/usr/share/pyshared/openerp/addons/web/static/src/img
The logo at the log in prompt. This could be at any size

main.py
/usr/share/pyshared/openerp/addons/web/controllers
Use to change the log-in screen title (reboot is required for changes to take effect)
Look for html_template and check the content of the title beginning with <title>
----------------------------------------------------------------------------------------------

Thursday 13 September 2012

OpenERP Create a new module basic



Opnerp create a new module
What you need to create a basic module is only 4 files……
1.       __init__.py
2.       __openerp__.py
3.       Html.py
4.       html_view.py

·         In init.py file what we need to do is just to import the module name like
Import test
·         In the opener.py file we need a few description regarding the module like
{
    "name" : "Html View",
    "version" : "1.1",
    "author" : "OpenERP SA",
    "category" : "Hidden/Test",
    "depends" : ['base'],
    "init_xml" : ['html_view.xml'],
    "demo_xml" : [],
    "description": """
This is the test module which shows HTML tag support in normal XML form view.
=============================================================================

Creates a sample form-view using HTML tags. It is visible only in OpenERP Web.
    """,
    'update_xml': ['security/ir.model.access.csv','html_view.xml',],
    'installable': True,
    'auto_install': False,
    'certificate': '001302129363003126557',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

·         In the html.py file we describe the types of fields that we want to use


from osv import osv, fields

class html_view(osv.osv):
    _name = 'html.view'
    _columns = {
        'name': fields.char('Name', size=128, required=True, select=True),
        'comp_id': fields.many2one('res.company', 'Company', select=1),
        'bank_ids': fields.one2many('res.partner.bank', 'partner_id', 'Banks'),
    }
   
html_view()

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:


·         And lastly the html_view.xml file we use for the view which will be appearing in the window

<?xml version="1.0" encoding="utf-8"?>
<openerp>
  <data>
    <record id="html_view_form" model="ir.ui.view">
      <field name="name">htmlform</field>
      <field name="model">html.view</field>
      <field name="type">form</field>
      <field name="arch" type="xml">
        <form string="Html Example">
        
            <field name="name"/>
              
            <field name="bank_ids"/>
        
    </record>
    <record id="action_html_view_form" model="ir.actions.act_window">
      <field name="name">Html Test</field>
      <field name="type">ir.actions.act_window</field>
      <field name="res_model">html.view</field>
      <field name="view_type">form</field>
    </record>
    <menuitem action="action_html_view_form" id="html_form" parent="base.menu_address_book" sequence="40"/>
  </data>
</openerp>

THINGS TO REMEMBER
1.       Line spacing that is the intent of the lines
2.       The module once coded must be copied to the addons folder of opener
3.       To install the module follw the steps
1.       Open the settings in opener if you are using opener v 6.1
2.       Then click on modules > update module list
3.       It will be taking some time and return that 1 module is added just as you close the window by clicking OK button we are diverted to module list.
4.       We will have to search there with the name of the module we have created.
5.       Then just press the install button to install the module
6.       ENJOY YOURS MODULE IS READY…………….

Last thing i would recommend to any beginner is to just read the Idea module of openerp any one can have a good hands with that module as that contains nearly all the things one needs to learn.

Monday 10 September 2012

Installing Openerp 6.1 On Ubuntu 10.4LTS

Installing openerp on ubuntu 10.4 LTS is very easy task to do
Just following the steps mentioned u can install Openerp in less than 20 mins.
1.       sudo apt-get install openssh-server denyhosts
2.       sudo apt-get update
3.       sudo apt-get dist-upgrade
4.       sudo adduser --system --home=/opt/openerp --group opener
5.       sudo su - openerp -s /bin/bash
6.       sudo apt-get install postgresql
7.       sudo su – postgres
8.      createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt openerp
Enter password for new role: ********
Enter it again: ********
9.       exit
10.   sudo apt-get install python-dateutil python-feedparser python-gdata \
python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 \
python-pybabel python-pychart python-pydot python-pyparsing python-reportlab \
python-simplejson python-tz python-vatnumber python-vobject python-webdav \
python-werkzeug python-xlwt python-yaml python-zsi
11.   sudo apt-get install python-pip
12.   sudo apt-get remove python-werkzeug
13.   sudo pip install werkzeug
15.   cd /opt/opener
16.   sudo tar xvf ~/openerp-6.1-1.tar.gz
17.   sudo chown -R openerp: *
18.   sudo cp -a openerp-6.1-1 server
19.  The default configuration file for the server (in /opt/openerp/server/install/) is actually very minimal and will, with only one small change work fine so we’ll simply copy that file to where we need it and change it’s ownership and permissions:
sudo cp /opt/openerp/server/install/openerp-server.conf /etc/
sudo chown openerp: /etc/openerp-server.conf
sudo chmod 640 /etc/openerp-server.conf
The above commands make the file owned and writeable only by the openerp user and group and only readable by openerp and root.

20.  To allow the OpenERP server to run initially, you should only need to change one line in this file. Toward to the top of the file change the line db_password = False to the same password you used back in step 3. Use your favourite text editor here. I tend to use nano, e.g.
sudo nano /etc/openerp-server.conf
21.  One other line we might as well add to the configuration file now, is to tell OpenERP where to write its log file. To complement my suggested location below add the following line to the openerp-server.conf file:
logfile = /var/log/openerp/openerp-server.log

22.  Once the configuration file is edited and saved, you can start the server just to check if it actually runs.
sudo su - openerp -s /bin/bash
/opt/openerp/server/openerp-server
23.  For the final step we need to install a script which will be used to start-up and shut down the server automatically and also run the application as the correct user. There is a script you can use in /opt/openerp/server/install/openerp-server.init but this will need a few small modifications to work with the system installed the way I have described above. Here’s a link to the one I’ve already modified for 6.1-1.
Similar to the configuration file, you need to either copy it or paste the contents of this script to a file in /etc/init.d/ and call it openerp-server. Once it is in the right place you will need to make it executable and owned by root:
sudo chmod 755 /etc/init.d/openerp-server
sudo chown root: /etc/init.d/openerp-server
24.  In the configuration file there’s an entry for the server’s log file. We need to create that directory first so that the server has somewhere to log to and also we must make it writeable by the openerp user:
sudo mkdir /var/log/openerp
sudo chown openerp:root /var/log/openerp
25.  To start the OpenERP server type:
sudo /etc/init.d/openerp-server start
You should now be able to view the logfile and see that the server has started.
less /var/log/openerp/openerp-server.log
If there are any problems starting the server you need to go back and check. There’s really no point ploughing on if the server doesn’t start…
If the log file looks OK, now point your web browser at the domain or IP address of your OpenERP server (or localhost if you are on the same machine) and use port 8069. The url will look something like this:
http://IP_or_domain.com:8069
What you should see is a screen like this one:
26.  What I do recommend you do at this point is to change the super admin password to something nice and strong (Click the “Manage Databases” link below the main Login box). By default this password is just “admin” and knowing that, a user can create, backup, restore and drop databases! This password is stored in plain text in the /etc/openerp-server.conf file; hence why we restricted access to just openerp and root. When you change and save the new password the /etc/openerp-server.conf file will be re-written and will have a lot more options in it.
Now it’s time to make sure the server stops properly too:
sudo /etc/init.d/openerp-server stop
Check the logfile again to make sure it has stopped and/or look at your server’s process list.
If everything above seems to be working OK, the final step is make the script start and stop automatically with the Ubuntu Server. To do this type:
sudo update-rc.d openerp-server defaults
You can now try rebooting you server if you like. OpenERP should be running by the time you log back in.
If you type ps aux | grep openerp you should see a line similar to this:
openerp 1491 0.1 10.6 207132 53596 ? Sl 22:23 0:02 python /opt/openerp/server/openerp-server -c /etc/openerp-server.conf
Which shows that the server is running. And of course you can check the logfile or visit the server from your web browser too.