From ab02ca6b3609a5040d8f4eb9e04bec410f72a50d Mon Sep 17 00:00:00 2001 From: Christopher Ormaza Date: Tue, 26 Sep 2023 15:42:33 -0500 Subject: [PATCH] [FIX] quants can be more than one on _gather function result --- rma/wizards/rma_make_picking.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rma/wizards/rma_make_picking.py b/rma/wizards/rma_make_picking.py index 02835c752..4105e2535 100644 --- a/rma/wizards/rma_make_picking.py +++ b/rma/wizards/rma_make_picking.py @@ -227,14 +227,14 @@ def action_create_picking(self): "lot_ids": [(6, 0, move.rma_line_id.lot_id.ids)], } ) - quant = self.env["stock.quant"]._gather( + quants = self.env["stock.quant"]._gather( move.product_id, move.location_id, lot_id=move.rma_line_id.lot_id ) move.move_line_ids.write( { "product_uom_qty": 1 if picking_type == "incoming" else 0, "qty_done": 0, - "package_id": quant.package_id.id if quant.package_id else None, + "package_id": len(quants) == 1 and quants.package_id.id, } ) elif move.product_id.tracking == "lot":