Adrien WidartandFlorent de Labarre f53b702071 [FIX] stock: transfer the package level to backorder
The packages reservations are not correctly done in case of a backorder

To reproduce the issue:
(Use demo data)
1. In Settings, enable:
    - Delivery Packages
    - Multi-Step Routes
2. Edit the warehouse:
    - Outgoing Shipments: 2 steps
3. In Operations Types > Delivery Order, enable:
    - Show Detailed Operations
    - Move Entire Packages
4. Create a Pick P:
    - 1 x [DESK0004] Desk
    - 1 x Large Cabinet
5. Put each product in a separate pack
6. Validate P
7. Create a Delivery Order (Planned Transfer):
    - 1 x [DESK0004] Desk
    - 1 x Large Cabinet
8. Mark as TODO, Check Availability
9. In Detailed Operations, mark one of the packs as Done
10. Validate the DO, Create a backorder

Error: The not-yet-done pack is still on the delivery order and its
status is "Reserved". This line shouldn't be present anymore. Moreover,
the backorder has a line for this pack, its state is "Draft" (instead of
"Reserved") and the state of the BO is Ready.

When creating the backorder, the packages levels of the not-yet-done
moves are transferred to the new picking (i.e., the backorder) However,
these moves does not have a package level defined (due to
9d758fa2e1). Therefore, when checking the
packs:
https://github.com/odoo/odoo/blob/e7450bee8f018a5334d9628235824f2fc6f32cec/addons/stock/models/stock_picking.py#L822-L832
`package_level_ids` is empty, so a new `stock.package_level` is created
(instead of using the one of the initial delivery order). And
`move_lines_to_pack` is empty too, so the new `stock.package_level`
won't have any move lines and its state will be "Draft"

We should rather transfer the package levels of the moves' lines.

OPW-2659176
closes #77509

closes odoo/odoo#80072

X-original-commit: 4fd5cd6f940575090021dedd2159d050b594dd69
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
Co-authored-by: Adrien Widart <awt@odoo.com>
Co-authored-by: Florent de Labarre <florent.mirieu@gmail.com>
2021-11-19 13:37:29 +00:00
2021-10-21 19:09:48 +00:00
2021-11-19 11:22:53 +00:00
2021-11-16 12:20:02 +00:00
2021-10-21 19:09:48 +00:00
…
…
…
…
2021-11-04 10:21:58 +00:00
2021-10-21 19:09:48 +00:00
2021-10-07 17:59:53 +00:00
2021-10-21 19:09:48 +00:00
2021-10-21 19:09:48 +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%