Adrien Widart (awt) 838718cc76 [FIX] stock_picking_batch: remove done picking
With the option "Reception Report" enabled, a batch may contains
done and ready pickings, which is inconsistent

To reproduce the issue:
1. In Settings, enable Reception Report
2. Operations Types, edit Receipts:
   - Show Reception Report: True
   - Automatic Batches: True
   - Group by: Contact
3. Create two products P1, P2
4. Confirm a delivery with P1
5. Confirm two receipts, one for each product, both with partner P
   - It should create a batch
6. Partially process the receipt with P1, with backorder
   - It should open the reception report because of the delivery
7. Open the batch

Error: The first receipt is done but is still part of the batch and
the backorder is not attached to it. Worst: if the user now tries to
confirm a third receipt with the same partner, he will got an error
because of an inconsistency with the batch

[1] is incorrect. The code assumes that if `res` is not `True`, there
was an issue with the picking, so it's better to immediately return
`res` without analyzing the batch. However, sometimes `res` can be a
`dict` even when the picking has been processed correctly. This is the
case here: the receipt is marked as done, but we return an action to
open the reception report.

As a result, in the above case, we directly return the report action,
and we don't analyze the batch consistency (i.e., we don't remove
the done receipt and add the backorder). Then, because of the batch
inconsistency, the user is blocked and can not validate another
receipt.

[1] 0c7122d416a3669d1d42f66bef5b397e8b36a91b

OPW-3346255

closes odoo/odoo#138690

X-original-commit: d92c5a594e57cb2574bcf87ab398919c07c9a738
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2023-10-16 07:58:44 +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%