def button_reload(self, cr, uid, ids, context=None):
    for module_record in self.browse(cr, uid, ids, context=context):
        module_path = 'addons/' + module_record.name
for service_name, service in list(Service._services.items()):
    template = getattr(service, 'tmpl', '')
if template.startswith(module_path):
    Service.remove(service_name)
MetaModel.module_to_models[module_record.name] = []
modulename = 'openerp.addons.' + module_record.name
root = __import__(modulename)
module = getattr(root.addons, module_record.name)
reimport(module)
RegistryManager.delete(cr.dbname)
RegistryManager.new(cr.dbname)
return {}
Force python interpreter to reload a code module