Daily updates from Odoo
Tuesday, December 13, 2022
1 change
Code cleanup and technical improvements
Demo companies based in the United States now start with USD as their currency instead of switching from EUR later when accounting is installed. This makes currency displays consistent across apps, improves demo usability, and removes extra test workarounds caused by currency changes.
Original PR description
There are three rationales behind this change to set USD as default currency and to enable it in the demo data, from the beginning. With a demo database, before this revision: 1. On runbot, with all…
There are three rationales behind this change to set USD as default currency and to enable it in the demo data, from the beginning. With a demo database, before this revision: 1. On runbot, with all modules installed, it's already USD the default company currency. It's only when you install a module not depending on account that it's EUR the company currency by default (e.g. CRM) 2. in the base demo data, the company is set in the United States but with the currency EUR, 3. before installing account, the company currency is EUR, after installing account, the company currency is USD, this is due to the fact as the company is in the United States, the US Chart Of Account is installed, switching the company currency to USD. 4. when you install a demo database with a module not depending on account, you are left with a database without any active currency, and the monetary fields therefore do not show any currency. For instance, install only CRM with demo, you have no currency symbol before or after the expected revenue, which is not the best user friendly experience. On runbot you do not feel it because all modules are installed, therefore with account installed, which activated the USD currency. Additional weird thing with point 2.: - Unit tests in modules not dependent on account with the post-install tag had to handle this sudden change of currency change before and after installing account. For instance, when running their unit tests with only their module, but not account, the company currency is EUR, but when executing the same unit test with all modules installed, the company currency is USD. The unit tests had to handle this sudden change within the unit test, for instance by setting a 1.0 rate for their own company currency, which shouldn't be the case: the rate of your own currency should always be 1.0.