65c23b4bc75f0b30f8b24fd5ddbf50ea63c65ad9
Current behavior: When a refund order is created, the amount is not rounded the same way as the orginial order. Steps to reproduce: - Create a rouding method with 0.05 as rounding value, with the DOWN rounding method - Create an order with a product of price 1.98 - Validate the order, the price should be 1.95 - Create a refund order for the previous order - Validate the refund order, the price should be -1.95 but it's -2.00 Solution: Always act like the order has a positive amount, and apply the rounding the normal way. Then apply the sign of the original order. If the remaining amount has a different sign than the original total, we should invert the rounding method to apply a rounding in the same "direction" as the original order. For example : - Original order is -1.98 - Rounding is applied and the total is -2.00 - After the payment, the remaining is -1.98 - -2.00 = 0.02 - Wich will be rounded to 0.05 wich is not correct, it should be rounded to 0.00. So we invert the rounding method to apply a rounding in the same "direction" as the original order. If we don't do this the total due would have been -1.95 instead of -2.00. And the change would have been 0.05 instead of 0.00. opw-3106656 closes odoo/odoo#109422 X-original-commit: c92074e8ec5b4a11fa90f08a16c859bb72234863 Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com> Signed-off-by: Engels Robin (roen) <roen@odoo.com>
…
…
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
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%