From 69dd3dfa90524c835eac217ddbf339d5ce53e72e Mon Sep 17 00:00:00 2001 From: Darshil Trivedi Date: Wed, 4 Jul 2018 15:31:09 +0530 Subject: [PATCH] [FIX] stock: scrap: bypass confirmation wizard if not storable If a user wants to scrap more quantity than he has in stock, we return to him a confirmation wizard. This doesn't make sense when scrapping consumables products, as there are no quants for these kind of products. task 1864026 --- addons/stock/models/stock_scrap.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/models/stock_scrap.py b/addons/stock/models/stock_scrap.py index 18be25ee1d2..517814573bc 100644 --- a/addons/stock/models/stock_scrap.py +++ b/addons/stock/models/stock_scrap.py @@ -121,6 +121,8 @@ class StockScrap(models.Model): def action_validate(self): self.ensure_one() + if self.product_id.type != 'product': + return self.do_scrap() precision = self.env['decimal.precision'].precision_get('Product Unit of Measure') available_qty = sum(self.env['stock.quant']._gather(self.product_id, self.location_id,