[FIX] rma_scrap: minor lint error

[FIX] rma_scrap: ensure scrapping serials will scrap just 1 unit & ensure scrapped quantity is always positve
[FIX] rma_scrap: scrap quantity should consider the quantity in the stock moves not the product_uom_qty
[IMP] rma_scrap: test serial case
This commit is contained in:
AaronHForgeFlow
2024-05-06 18:39:40 +02:00
committed by JasminSForgeFlow
parent fc83285b6e
commit 3c5f311f84
4 changed files with 101 additions and 5 deletions

View File

@@ -49,7 +49,7 @@ class RmaOrderLine(models.Model):
for move in rec.move_ids.filtered(
lambda m: m.state in ["done"] and m.is_rma_scrap
):
qty += product_obj._compute_quantity(move.product_uom_qty, rec.uom_id)
qty += product_obj._compute_quantity(move.quantity, rec.uom_id)
rec.qty_scrap = qty
def _compute_scrap_count(self):