Skip to main content

How to change default and internal currency in self-hosted Odoo or OpenERP

If you wish to use Odoo in a single-currency environment, you will find issues changing the currency in the Odoo interface itself. If you have a self-hosted solution of Odoo or OpenERP, you already have unprecedented control over the system, unlike the cloud-based solution from Odoo. This means that you can very easily fix the issue by hacking the database that Odoo is relying on. Even in a multi-currency environment, you can use the same trick to change the global default currency - the fix is very clean for any environment - there is just an extra step to update the currency rate settings.

Even in the latest version of Odoo, we still face the ridiculous bug that Odoo internally ALWAYS uses EUR (Euro) as the internal currency. This has created many problems for many users wanting to use a different currency. Despite being set to a different currency from the Odoo interface, the eCommerce site, reports, accounting, etc are still shown using EUR and the Euro symbol, creating confusion and accounting problems.

Odoo Support has done nothing yet to correct this critical problem in their software which renders their otherwise excellent software for SME business into merely a toy for a hobbyist to play around with. The internet is full of dissatisfied Odoo customers looking for a solution, and many "solutions" revolve around playing with the accounting settings, multi-currency settings, currency rates, etc.

I don't know whether you have this problem or you can fix it if you purchased Odoo cloud service. But if you are installing and using a self-hosted Odoo solution, you can use the following trick to fix the issue at the very heart of Odoo. Since Odoo uses a Postgres database to store all the data, we can connect to the database directly and modify the data inside, thus changing the behavior of Odoo. NOTE that the database is like Windows registry or Linux /etc - drastic careless modification can render your whole Odoo system useless.

Note that you should not use the Odoo interface to change the default currency for the business or otherwise. If you already did so, now would be a good time to change it back to the default currency, which is the Euro (EUR). (Or after the below procedure, change to your target currency).

Log on to your server by SSH or PuTTY, and connect to the Postgres database client using the following command:
sudo -u postgres psql

Connect to your database using the command (replace <database name> with the actual name of your database - to see the list of databases, use \l ):
\c <database name>

Here you will require some knowledge about databases, SQL writing, and Postgres in particular. I will expand the post with some actual usable commands later. But following is the gist of procedure:
  1. In res_currency table, there will be an entry for EUR, and there may be an entry for your currency.
  2. Your fix will be to swap them around, so that the ID for EUR refers to your currency, and the ID for your currency refers to EUR. That way, your currency becomes the global default for Odoo.
  3. You can also fix the symbol of your currency. Note that this will usually require placing the SQL in an UTF-8 file so that your currency symbol can be stored in the table correctly - typing or pasting it directly into the terminal may convert the symbol to question mark or some other gibberish.
  4. If you could not find an entry for your currency, you will need to create it, then do the swapping with EUR.
  5. If you have stored currency rates in a multi-currency environment, you will also need to update res_currency_rate table to swap the ID for EUR and the ID for your new default currency.


Popular posts from this blog

Disable auto save in JetBrains IDE software (IntelliJ IDEA, PyCharm, PhpStorm)

JetBrains provides the following IDE software:
IntelliJ IDEAPhpStormPyCharmRubyMineWebStormAppCodeCLion Google also provides Android Studio which is powered by the IntelliJ platform.

If you come from a different IDE such as Eclipse, you will be unpleasantly surprised to find that JetBrains-branded IDEs automatically save everything the moment you look away. The proponents argue that as you work on your project, you should not have to worry about saving files. But to others, this auto-save behavior which is enabled by default is a curse that catches them by surprise, and a shocking departure from the workflow they are very much used to.

You can change the behavior by altering some settings.

Stop having to click Unblock on every downloaded file

CAUTION: The blocking of downloaded files in Windows is a security and safety feature to help prevent your computer from being infected by viruses and other malware. Only disable this feature if you know what you're doing.

I had been plagued by this annoyance since the days of Windows Vista. Any downloaded file, no matter what browser I use, gets tagged as "blocked" by Windows. You can open downloaded documents even though they are blocked, but when you run a downloaded application (such as a setup file) you're presented with a "Security Warning" before you're allowed to run it. It's worse if you extract a downloaded ZIP file with the Windows' built-in ZIP management. Every extracted file is blocked by default.

Being a geek who finds unnecessary "security" prompts annoying, the first thing I do in Windows is to disable the User Account Control (UAC). But I couldn't quite figure out how to disable blocking of downloaded files until …

Setting up a local Oracle XE database and importing DMP file

The experience of setting up a local Oracle Express Edition database is not a straight-forward as it should be. The following is supposed to outline what could go wrong and how to go about it the right way. It also includes importing a DMP file (a dump) from another system.
First of all, download the installer from Oracle website. You will need to sign-in to download - the account creation is free. Be sure to choose the correct bit as per your computer (x64 or x86).Extract the download and install XE by running DISK1\setup.exe (and feel nostalgic of the floppy disk era). During installation, you will need to choose a new password. There will also be some details displayed after you enter the new password, such as folders and ports.Be sure to save both password and details in a text file for future reference.I saved it as C:\oraclexe\details.txt.Save password only if it's generic and you are likely to forget. The installation will take a while, but usually, no restart is necessary.O…