diff options
| author | Laurent Smet <las@odoo.com> | 2020-03-04 09:02:43 +0000 |
|---|---|---|
| committer | Laurent Smet <las@odoo.com> | 2020-03-04 16:08:19 +0000 |
| commit | 6282e4546256278750df39fe39b83e74b504cbc5 (patch) | |
| tree | 4e9ffb7c9a8afeec6c0a92855f259becb5eae405 /addons/web/static/src/xml/debug.xml | |
| parent | 4501e3081d4744f78e3694ad4abf07bdbd4d59f4 (diff) | |
[FIX] account: Fix onchange_currency triggered for COGS (anglo-saxon)
When creating a new invoice, the date is not set by default. This date is set when posting it.
Otherwise, since the date changed, we need to trigger onchange_currency to manage the new
conversion rate at the new date set. Otherwise:
1) anglo-saxon lines never have a foreign currency.
2) it will recompute the balance based on the subtotal. Using a FIFO method, the
price_unit is computed as an average and, in our case, the price_unit should be
9.33333333 x 6 = 56. Then, at the creation of the invoice, balance=56 and
price_unit is rounded by the orm to 9.33. When posting the invoice, since onchange_currency
is triggered after setting the invoice date, the balance is recomputed as 9.33 * 6 = 55.98.
github issue: 46615
closes odoo/odoo#46917
Co-author: sle-odoo (sle@odoo.com)
X-original-commit: 19251c684119a537111126d15374e3d0b6e040b3
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Diffstat (limited to 'addons/web/static/src/xml/debug.xml')
0 files changed, 0 insertions, 0 deletions
