summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosse Colpaert <jco@odoo.com>2017-09-25 14:50:41 +0200
committeramoyaux <arm@odoo.com>2017-09-27 18:10:20 +0200
commit3d0d8b89d1e7a32a5ef8aa0f40d41a4fb5260c1c (patch)
tree867ed759c3a88a97fd8e0621dd78fa93fc31054b
parentede5ea53acb878151681e1299f63ad5f18cb10ae (diff)
[FIX] mrp: give error when no lot on produce in produce wizard
-rw-r--r--addons/mrp/wizard/mrp_product_produce.py4
1 files changed, 3 insertions, 1 deletions
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'))