AttributeError when moving object with script
When you select multiple objects one of them is highlighted in a lighter colour. This "lighter" object is known as the active object and is the object that bpy.context.object refers to. This active object may be just one of many selected objects that is listed in bpy.context.selected_objects.

When manipulating objects using python the active object can be left undefined or no longer pointing to a valid object. In this situation you will get the 'NoneType' object error which is saying that the variable you used (bpy.context.object) is a NoneType or null and non existent object so has no location attribute (or any other attributes).

Using bpy.context.object and bpy.context.selected_objects are convenience properties that allows a script to dynamically work with the currently selected objects and allow it to differentiate the one active object. An example is the copy attributes addon which can take a property from the active object and apply it to the rest of the selected objects.

If you know the name of the object you want your script to work on then accessing it through bpy.data.objects['name'] will reliably refer to that object every time. If you want to use an operator that works on the active object, then you can set the active object with bpy.context.scene.objects.active = bpy.data.objects['name']