From 815f27fedf5da0b1772f231cd565982da5df836c Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Thu, 12 Jan 2012 17:14:57 +0530 Subject: [PATCH] [IMP]mrp_repair: added a message when repair order without repair line bzr revid: mma@tinyerp.com-20120112114457-yheegsrhr8tikbuy --- addons/mrp_repair/mrp_repair.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index e1216332ae4..e420ebdbf68 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -330,6 +330,8 @@ class mrp_repair(osv.osv): self.write(cr, uid, [o.id], {'state': '2binvoiced'}) else: self.write(cr, uid, [o.id], {'state': 'confirmed'}) + if not o.operations: + raise osv.except_osv(_('Error !'),_('You cannot confirm a repair order which has no line.')) for line in o.operations: if line.product_id.track_production and not line.prodlot_id: raise osv.except_osv(_('Warning'), _("Production lot is required for opration line with product '%s'") % (line.product_id.name))