Skip to content
Snippets Groups Projects
Commit d11a8049 authored by Simon Lejeune's avatar Simon Lejeune
Browse files

[FIX] stock: scrap: consider reserved quantity

parent 0556b7fe
No related branches found
No related tags found
No related merge requests found
......@@ -118,12 +118,12 @@ class StockScrap(models.Model):
def action_validate(self):
self.ensure_one()
precision = self.env['decimal.precision'].precision_get('Product Unit of Measure')
available_qty = self.env['stock.quant']._get_available_quantity(self.product_id,
self.location_id,
self.lot_id,
self.package_id,
self.owner_id,
strict=True)
available_qty = sum(self.env['stock.quant']._gather(self.product_id,
self.location_id,
self.lot_id,
self.package_id,
self.owner_id,
strict=True).mapped('quantity'))
if float_compare(available_qty, self.scrap_qty, precision_digits=precision) >= 0:
return self.do_scrap()
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment