Laurent Smet 6282e45462 [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>
2020-03-04 16:08:19 +00:00
2020-02-13 11:45:39 +00:00
2020-03-04 10:39:36 +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%