[MERGE] mrp_repair: add check to prevent confirmation of repair order without line

bzr revid: rco@openerp.com-20120130150434-qwc16oe1edjh1y13
This commit is contained in:
Raphael Collet
2012-01-30 16:04:34 +01:00
+2
View File
@@ -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))