Skip to content

Commit

Permalink
Merge commit 'refs/pull/1675/head' of https://github.com/oca/sale-wor…
Browse files Browse the repository at this point in the history
…kflow into 13.0-2482
  • Loading branch information
docker-odoo committed May 23, 2023
2 parents 83697f6 + c876daa commit 5266a54
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions sale_order_lot_selection/models/stock.py
Expand Up @@ -14,7 +14,10 @@ def _update_reserved_quantity(
owner_id=None,
strict=True,
):
if self._context.get("sol_lot_id"):
if (
self.sale_line_id.lot_id
and available_quantity >= self.sale_line_id.product_uom_qty
):
lot_id = self.sale_line_id.lot_id
return super()._update_reserved_quantity(
need,
Expand All @@ -30,6 +33,12 @@ def _prepare_move_line_vals(self, quantity=None, reserved_quant=None):
vals = super()._prepare_move_line_vals(
quantity=quantity, reserved_quant=reserved_quant
)
if reserved_quant and self.sale_line_id.lot_id:
vals["lot_id"] = self.sale_line_id.lot_id.id
lot = self.sale_line_id.lot_id
if (
reserved_quant
and reserved_quant.lot_id
and lot
and reserved_quant.lot_id == lot
):
vals["lot_id"] = lot.id
return vals

0 comments on commit 5266a54

Please sign in to comment.