[FIX] rma: outgoing moves and pickings

This commit is contained in:
DavidJForgeFlow
2023-04-03 15:38:17 +02:00
parent a898c177ed
commit 19cfe3a991

View File

@@ -77,7 +77,10 @@ class RmaOrderLine(models.Model):
for move in self.move_ids:
first_usage = move._get_first_usage()
last_usage = move._get_last_usage()
if first_usage == "internal" and last_usage != "internal":
if first_usage in ("internal", "production") and last_usage in (
"customer",
"supplier",
):
moves |= move
elif first_usage == "supplier" and last_usage == "customer":
moves |= moves
@@ -89,7 +92,10 @@ class RmaOrderLine(models.Model):
for move in self.move_ids:
first_usage = move._get_first_usage()
last_usage = move._get_last_usage()
if first_usage in ("internal", "production") and last_usage != "internal":
if first_usage in ("internal", "production") and last_usage in (
"customer",
"supplier",
):
pickings |= move.picking_id
elif last_usage == "customer" and first_usage == "supplier":
pickings |= move.picking_id