def get_file(self, cr, uid, ids, field_name=None, arg=None,context=None):result = dict.fromkeys(ids)for record_browse in self.browse(cr, uid, ids):addons_path = http.addons_manifest['web']['addons_path']f = open(os.path.join(addons_path,'modulename','static','src','img', 'image.png'), 'rb')result[record_browse.id] = base64.encodestring(f.read())f.close()return result_columns = {
'web_icon': fields.function(get_file, method=True,store=False,type='binary',string="Download File"),}