Wednesday, January 28, 2015

Run OpenERP server and Upgrade custom modules/Addons through Command Line/Terminal

1) Change your directory to openerp.

For Example:

My openerp folder is placed in the home directory i.e. /home/ujwala/ ,

cd /home/ujwala/openerp

Normally, for running openerp server we only provide openerp-server command.

2) Now for Running the server and upgrading the custom addons in one go use the following command:

./openerp-server --addons-path=/home/ujwala/openerp/addons -u custom_module_name

here,
'--addons-path' is nothing but the total path till addons i.e. /home/ujwala/openerp/addons/,

'-u custom_module_name' used to upgrade the specified custom module

3) Also to upgrade a custom module for a specific database, use the following command:

./openerp-server –addons-path=/home/ujwala/openerp/addons -u custom_module_name -d dbname

'-d dbname' used for upgrading the module for a given database name.

Thats it.

Normally, for upgrading the modules through browser we usually go to settings-->Installed Modules then delete the “Installed” filter in the search box, search for the module and then upgrade it. Which is usually the longest process.

Whereas above commands will save your time and you can upgrade the modules by hitting a single command.

Note: For upgrading more than one custom addons/modules provide module names being comma separated i.e. -u custom_module1,custom_module2
(Dont give a space after comma.)

Wednesday, January 14, 2015

In openERP, Get same value of one text field into another text field on change or on click of Checkbox


In openERP, Get same value of one text field into another text field on change or on click of Checkbox

This is the simple method used in openERP without writing the Javascript function.
Here I have taken example of Permanent Address will be same as Home Address if user checks the 'same as above' checkbox

Define your fields in .py file

_columns = {
'home_address': fields.text('Home Address'),
'permanent_address': fields.text('Permanent Address'),
'same_as_above':fields.boolean('Same As Above'),
}

Write the onchange function on checkbox in .py file

Note: for defining a checkbox in OpenERP the type of field will be a 'boolean'

def onchange_same_as_above(self,cr, uid, ids,same_as_above,home_address,context=None):
    value={}
    if same_as_above and home_address_new:
        if same_as_above == True:
            value = {'permanent_address':home_address}
    else:
        value = {'permanent_address':''}
    return {'value':value}

To display the above fields on the form write it in .xml file

<field name="home_address"/>
<field name="same_as_above" on_change="onchange_same_as_above(same_as_above, home_address)"/>
<field name="permanent_address" placeholder="Check Above Checkbox If Permanent Address is same as Home Address"/>















Below figure shows when user checks the 'Same As Above' checkbox 'Permanent Address' will be same as 'Home Address'

















Note: When user unchecks the checkbox 'Permanent Address' field will be blank.

Thanks,

Ujwala H. Pawade..



Tuesday, January 13, 2015

OperationalError: fe_sendauth: no password supplied error


In OpenERP, OperationalError: fe_sendauth: no password supplied error



Sometimes while running OpenERP server after fresh installation you may get following error :

2015-01-13 06:21:15,798 7695 ERROR ? openerp.sql_db: Connection to the database failed
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20150113-py2.7.egg/openerp/sql_db.py", line 442, in borrow
result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 179, in connect
connection_factory=connection_factory, async=async)
OperationalError: fe_sendauth: no password supplied



Steps suggested to get rid of this error:

1. Stop your OpenERP server using ctrl+c.

2. Stop your PostgreSQL server : $ sudo /etc/init.d/postgresql stop

3. Edit your PostgreSQL configuration file i.e. pg_hb.conf using nano or gedit editor :
$ sudo gedit /etc/postgresql/9.1/main/pg_hba.conf
4. As requested give a sudo password to open the file.
5. Now, In the pg_hba.conf file serach for following lines:
# "local" is for Unix domain socket connections only
local         all        all        peer
Here, in above line type of connection used is “peer”, change it to a “trust” i.e.
local         all        all        trust
Now, Save and close the file.
6. After making the above changes to the configuration file i.e. pg_hba.conf, Reload and start the PostgreSQL server :
$ sudo /etc/init.d/postgresql reload
$ sudo /etc/init.d/postgresql start

7. Now start OpenERP server and hit the url to http://localhost:8069 in the browser.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thanks,
Ujwala H. Pawade..

Wednesday, January 7, 2015

सावर रे मना सावर रे .. (Lyrics of 'सावर रे एकदा, सावर रे/Saavar Re Mana' From Movie Mitwaa )



सावर रे मना सावर रे


सावल्या फुलांच्या पावले ही फुलांची..
वाट हळवी वेचताना..सावर रे मना
सावर रे सावर रे
सावर रे एकदा सावर रे

सावळ्या क्षणांचे भरून आल्या घनांचे
थेंब ओले झेलताना सावर रे मना
सावर रे सावर रे
सावर रे एकदा सावर रे

भान उरले ना जगाचे ना स्वत:चे
सोहळे हे जाणीवांचे नेणीवांचे
फितूर झाले रात दिन तू.. सावर रे
सावर रे मना सावर रे .. सावर रे
सावर रे एकदा सावर रे

मखमली हे प्रश्न थोडे रेशमाची उत्तरे
पायर्‍या थोड्या सुखाच्या अन् अबोली अंतरे
येतील आता आपले ऋतू
बघ स्वप्न हेच खरे

पालवीच्या सणांचे.. दिवस हे चांदण्यांचे..
पानगळ ही सोसताना .. सावर रे मना ..
सावर रे .. सावर रे ..
सावर रे एकदा सावर रे .

स्पर्श होता आत.. लाखो आर्जवांची झुंबरे
स्वप्न हे माझे तुझे अन् पापण्यांचे झुंबरे
जाईल आता आस ही उतू
बघ रात ही सरे
पावसाच्या फुलांचे.. दिवस हे पैंजणांचे
मी हवेतून चालतांना ..
सावर रे मना ..
सावर रे .. सावर रे ..
सावर रे एकदा सावर रे .