summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2020-01-06 14:19:22 +0000
committerNicolas Martinelli <nim@odoo.com>2020-01-07 08:13:41 +0000
commit81b69f393b0ee3b1e1c7d0c0565c55d9fb2d68cf (patch)
tree6813d14e8fd4535065cff15f52870e5bd462ee04 /addons/web/static/src/js/views/basic
parent691a22f808d8467e59a22a7edb692a53aa97e8a6 (diff)
[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>
Diffstat (limited to 'addons/web/static/src/js/views/basic')
0 files changed, 0 insertions, 0 deletions