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.

Comments

Popular posts from this blog

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

JetBrains provides the following IDE software: IntelliJ IDEA PhpStorm PyCharm RubyMine WebStorm AppCode CLion 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.

Make Samsung DVD-C350 region-free

Update 2: An anonymous commentator has shown me a way to make Region 1 players (such as DVD-H1080R) region-free by first converting it to Region 3, then applying my region-free hack below. For details, click here or look for a comment by an Anonymous user dated 18 April 2011. Update: The instructions in the original post below did not make the DVD player region-free. Instead it only locked it to region 1. Many thanks to Anonymous who posted the first comment on this post, I now have alternate instructions. Note: If you have edited the numbers menu (see original post) , I suggest you return it to the original settings you had backed up. A modified numbers menu may prevent the instructions below from working properly.

Group, Ungroup and Regroup disabled in Word

I was editing a Microsoft Word document which had a collection of shapes and text boxes grouped together. I wanted to modify some of the shapes, and therefore I had to ungroup them. But when I right-click the group and open the Group menu, all three options namely Group, Ungroup and Regroup are completely disabled or grayed out. I couldn’t figure out what’s wrong. This group of objects is perfectly ungroupable, and I can even select objects within the group. However, Microsoft Word 2007 is not letting me ungroup it. I searched the Internet for a solution, but did not find anything very useful. The closest I came across is this statement: “The type of Text Wrapping doesn't make any difference as long as it isn't In Line with Text.” ( Link here ) Anyway, I changed the text wrapping of the group of objects from ‘In line with Text’ to ‘Tight’ and viola! I could now ungroup it and edit it. The document got a bit messed up when I did so, but after I ungrouped, edited and regro