Nicolas Martinelli 81b69f393b [FIX] account, stock_account: valuation multi-currency
- Set USD as company currency
- Set the EUR rate to 1.5
- Create a product A: FIFO & automated, invoicing based on delivery
- Create a pricelist in EUR
- Buy some quantity @ 100 USD
- Create a SO for 1 @ 200 EUR
- Confirm the SO, validate the picking, generate the invoice
- Do not set an invoice date
- Post the invoice

The COGS are incorrect:

                            Amount Currency         Debit        Credit
Stock Interim (Delivered)              0.00          0.00         66.67
Expense                                0.00         66.67          0.00

It should be:

                            Amount Currency         Debit        Credit
Stock Interim (Delivered)              0.00          0.00        100.00
Expense                                0.00        100.00          0.00

Commit 3a6ada5 attempted to correct the issue, but it was only
working when an invoice date was set.

In the current situation, when no invoice date is set, there is a
conversion issue. This is because of [1], which ultimately calls [2].
This triggers a recomputation of the credit and debit in [3].

After the accounting refactoring, it is assumed that all AML have the
same currency than the AM. This is for the case in [4]. In case of the
COGS, it is not the case.

Note that we could have done the conversion in Amount Currency (see
PR #42646). But that leads to a recomputation of the debit and credit
which (1) is unnecessary and (2) could lead to rounding errors.

[1] https://github.com/odoo/odoo/blob/01a24fd1df32766a9ed6cedd571ed30c75ef726b/addons/account/models/account_move.py#L2079
[2] https://github.com/odoo/odoo/blob/01a24fd1df32766a9ed6cedd571ed30c75ef726b/addons/account/models/account_move.py#L2894
[3] https://github.com/odoo/odoo/blob/01a24fd1df32766a9ed6cedd571ed30c75ef726b/addons/account/models/account_move.py#L2725-L2726
[4] https://github.com/odoo/odoo/blob/f71979a681d95d98db19a80feb59fdf684ec361f/addons/account/models/account_move.py#L337-L339

opw-2148171
opw-2162068

closes odoo/odoo#42816

X-original-commit: 0aee89780c8825fd28cc5bf44048101ac7010eac
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-07 08:13:41 +00:00
2020-01-06 13:55:29 +00:00
…
…
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%