Touati Djamel (otd) c9f62d0b8b [FIX] purchase_stock: compare the quantities with float_compare
Steps to reproduce the bug:
- Create a storable product “P1”
- Create a PO with 7000 unit of P1
    - Receive for example “3,483.43”
    - Create a backorder
- Create a bill for received product
- Try to confirm the second picking

Problem:
Traceback is triggered, because the reaming quantity is 0 and we use it
in the division:

https://github.com/odoo/odoo/blob/16.0/addons/purchase_stock/models/stock_move.py#L57

In this use case we compare “3483.43” and ”3483.4300000003” but in fact
`”line.qty_invoiced == received_qyt”` so we should not go through this
part of the code:
https://github.com/odoo/odoo/blob/16.0/addons/purchase_stock/models/stock_move.py#L40

So as we used `float_round` in the calculation of `qty_invoiced`, we
have to use `float_compare` when comparing it with another value

https://github.com/odoo/odoo/blob/383947646f5652804bd6bbc764380a890e6f4a8d/addons/stock/models/stock_move.py#L1168

opw-3162603

closes odoo/odoo#111840

X-original-commit: 5899abdea4a622d11f0e7472b489616e08b74523
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-02-03 16:32:18 +01:00
2023-02-03 06:05:48 +01:00
2023-01-03 13:16:02 +01:00
…
…
…
…
2023-01-03 13:16:02 +01:00
…
2023-01-03 13:16:02 +01: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%