From 3d0d8b89d1e7a32a5ef8aa0f40d41a4fb5260c1c Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Mon, 25 Sep 2017 14:50:41 +0200 Subject: [PATCH] [FIX] mrp: give error when no lot on produce in produce wizard --- addons/mrp/wizard/mrp_product_produce.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mrp/wizard/mrp_product_produce.py b/addons/mrp/wizard/mrp_product_produce.py index 23ed113e49d..1fbc99c661b 100644 --- a/addons/mrp/wizard/mrp_product_produce.py +++ b/addons/mrp/wizard/mrp_product_produce.py @@ -137,7 +137,9 @@ class MrpProductProduce(models.TransientModel): self.env['stock.move.line'].create(vals) for pl in self.produce_line_ids: - if pl.qty_done and pl.lot_id: + if pl.qty_done: + if not pl.lot_id: + raise UserError(_('Please enter a lot or serial number for %s !' % pl.product_id.name)) if not pl.move_id: # Find move_id that would match move_id = self.production_id.move_raw_ids.filtered(lambda x: x.product_id == pl.product_id and x.state not in ('done', 'cancel'))