Auto reload Odoo server after Python code change

When you’re developing custom module or working on Python code, Odoo server needs to be restarted on every code change.

To make your life easier auto reload Odoo server after Python code change.

Option –auto-reload monitors the source code and automatically restart Odoo server if changes are detected.

Example of usage:

./odoo.py -d test_database --auto-reload

This is a Linux-only feature.

The pyinotify Python package is required, and it should be installed either through apt-get or pip:

Using apt-get:

sudo apt-get install python-pyinotify

Using pip:

pip install pyinotify

https://github.com/seb-m/pyinotify/wiki

Warning:

If you use PyCharm or some other IDE with auto save, disable auto save before using –auto-reload option.

Happy coding…

 

How to install Apache OpenOffice 4.1.1 on Ubuntu and Debian

How to install Apache OpenOffice 4.1.1 on Ubuntu and Debian – 32 bit OS

First thing is to remove the already installed versions of either openoffice and libreoffice:

$ sudo apt-get remove libreoffice* openoffice*
$ sudo apt-get autoremove

Next, we will download openoffice, extract the archive and install the deb packages:

$ wget sourceforge.net/projects/openofficeorg.mirror/files/4.1.1/binaries/en-US/Apache_OpenOffice_4.1.1_Linux_x86_install-deb_en-US.tar.gz
$ tar -xzvf Apache_OpenOffice_4.1.1_Linux_x86_install-deb_en-US.tar.gz
$ cd en-US/DEBS
$ sudo dpkg -i *.deb
$ cd desktop-integration
$ sudo dpkg -i *.deb

How to install Apache OpenOffice 4.1.1 on Ubuntu and Debian – 64 bit OS

First thing is to remove the already installed versions of either openoffice and libreoffice:

$ sudo apt-get remove libreoffice* openoffice*
$ sudo apt-get autoremove

Next, we will download openoffice, extract the archive and install the deb packages:

$ wget sourceforge.net/projects/openofficeorg.mirror/files/4.1.1/binaries/en-US/Apache_OpenOffice_4.1.1_Linux_x86-64_install-deb_en-US.tar.gz
$ tar -xzvf Apache_OpenOffice_4.1.1_Linux_x86-64_install-deb_en-US.tar.gz
$ cd en-US/DEBS
$ sudo dpkg -i *.deb
$ cd desktop-integration
$ sudo dpkg -i *.deb

Optional to remove Apache OpenOffice 4.1.1 on either 32 bit or 64 bit Ubuntu and Debian, do

$ sudo apt-get remove openoffice*

To start OpenOffice 4.1.1 from terminal use

$ openoffice4

How to install Apache OpenOffice 4.1.1 on Ubuntu and Debian

That’s it!

 

Odoo [Errno 98] Address already in use

Sometimes you may encounter an error in development or production [Errno 98] Address already in use.
This error is due to openerp-service or some other service already use port defined in your Odoo config.
You could try to change the port 8069 to any other port  and restart the server but that’s not the right way.

Just apply the command

sudo ps aux | grep openerp

which will show you the port on which openerp server is in running state.
Then kill the specific process.

sudo kill -9 id

For example sudo kill -9 999

Restart odoo server and that’s it.

 

Disable sudo timeout on Ubuntu in terminal

By default sudo remembers your password for 15 minutes.

Disable sudo timeout with this command:

sudo sh -c 'echo "\nDefaults timestamp_timeout=-1">>/etc/sudoers'

To re-enable sudo timeout use this command:

sudo sed -i "/Defaults timestamp_timeout=-1/d" /etc/sudoers

You can also change or disable sudo timeout with visudo.

sudo visudo

This opens an editor and points it to the sudoers file — Ubuntu defaults to nano, other systems use Vi.

To the defaults line, add :

timestamp_timeout=2

So it will look like this:

Defaults env_reset,timestamp_timeout=20

You might want to read the sudoers manual pages for additional information.

man sudoers

 

Remove LibreOffice on Ubuntu in terminal

To remove LibreOffice on Ubuntu in terminal:

sudo apt-get remove libreoffice-core

If you also want to remove LibreOffice configuration files, use the purge switch:

sudo apt-get remove --purge libreoffice-core

That’s all folks!