+ def unlink(self, cr, uid, ids, context=None):
+ if self.pool['mrp.production'].search(cr, uid, [('bom_id', 'in', ids), ('state', 'not in', ['done', 'cancel'])], context=context):
+ raise osv.except_osv(_('Warning!'), _('You can not delete a Bill of Material with running manufacturing orders.\nPlease close or cancel it first.'))
+ return super(mrp_bom, self).unlink(cr, uid, ids, context=context)
+