Skip to content
Snippets Groups Projects
Commit 3cbbbb36 authored by Goffin Simon's avatar Goffin Simon Committed by fw-bot
Browse files

[FIX] stock: Returning canceled moves


Steps to reproduce the bug:

- Let's consider two storable products P1 and P2 from the same vendor V
- P1 and P2 have the routes 'Buy' and 'Make to order'
- Create a SO for 1 P1 and 1 P2 and confirm it
- A delivery order DO has been created
- A PO has been created for V, confirm it
- Process the shipment, receive 1 P1 and 0 P2 with no backorder
- Process DO with no backorder
- Return DO by clicking on 'Return' button

Bug:

1 P1 and 1 P2 were suggested to be returned but the movement for P2 had been canceled.

Closes #39547
opw:2116582

closes odoo/odoo#40211

X-original-commit: bb94b6591fb148a4c1b94f9c28d2c10e44e12283
Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
parent ab9290e3
Branches
Tags
No related merge requests found
......@@ -50,6 +50,8 @@ class ReturnPicking(models.TransientModel):
if self.picking_id and self.picking_id.state != 'done':
raise UserError(_("You may only return Done pickings."))
for move in self.picking_id.move_lines:
if move.state == 'cancel':
continue
if move.scrapped:
continue
if move.move_dest_ids:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment