# -*- coding: utf-8 -*- from openerp.http import request as r def get_dashboard_objetive_widget(): user_store = r.env.user.store_id.id query = ''' SELECT store_id, date, sale_objetive, purchase_limit, expense_limit, payment_objetive FROM dashboard_objetive WHERE TO_CHAR(date,'YYYY-MM') = TO_CHAR(current_date,'YYYY-MM') AND store_id = ''' + str(user_store) + ''' ''' r.cr.execute(query) return [ { 'store_id': j[0], 'date': j[1], 'sale_objetive': j[2], 'purchase_limit': j[3], 'expense_limit': j[4], 'payment_objetive': j[5] } for j in r.cr.fetchall() ]