[IMP]mrp_repair: added a message when repair order without repair line

bzr revid: mma@tinyerp.com-20120112114457-yheegsrhr8tikbuy
This commit is contained in:
Mayur Maheshwari (OpenERP) 2012-01-12 17:14:57 +05:30
parent 813a847aff
commit 815f27fedf
1 changed files with 2 additions and 0 deletions

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))