# -*- coding: utf-8 -*- from openerp.http import request as r def get_widget_list(): user_id = r.env.user.id query = ''' SELECT --users.id, --partner.name, chart.name FROM res_users AS users --LEFT JOIN res_partner AS partner --ON partner.id = users.partner_id LEFT JOIN chart_list_users_rel AS chart_rel ON chart_rel.user_id = users.id LEFT JOIN chart_list AS chart ON chart.id = chart_rel.chart_id WHERE users.id = ''' + str(user_id) + ''' ''' r.cr.execute(query) return [ { 'name': j[0], } for j in r.cr.fetchall() ]