Skip to content

Commit

Permalink
Merge PR #1119 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Jan 4, 2024
2 parents 4704199 + 6c4941c commit cda113d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pos_order_return/models/pos_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,12 @@ def _create_picking_return(self):
if abs(to_return[move.product_id]) < move.quantity:
move.quantity = abs(to_return[move.product_id])
to_return[move.product_id] -= move.quantity
picking = self.env["stock.picking"].browse(wizard.create_returns()["res_id"])
picking = self.env["stock.picking"].browse()
# Avoid empty returns which will block the validation
if any(wizard.product_return_moves.mapped("quantity")):
picking = self.env["stock.picking"].browse(
wizard.create_returns()["res_id"]
)
normal_picking = self.env["stock.picking"]._create_picking_from_pos_order_lines(
self._get_picking_destination().id,
order_lines,
Expand Down

0 comments on commit cda113d

Please sign in to comment.