# -*- coding: utf-8 -*- from openerp.http import request as r def get_account_move_line(): user_store = r.env.user.store_id.id company_currency_rate = r.env.user.company_id.currency_id.rate query = ''' SELECT move.id, move_line.id, account.id, move.name, move_line.debit, move_line.credit, move_line.date_maturity, move_line.reconcile_ref, account.type, move_line.reconcile_partial_id FROM account_move AS move LEFT JOIN account_move_line AS move_line ON move_line.move_id = move.id LEFT JOIN account_account AS account ON account.id = move_line.account_id ORDER BY move_line.date_maturity ''' r.cr.execute(query) return [ { 'move_id': j[0], 'move_line_id': j[1], 'account_id': j[2], 'name': j[3], 'debit': j[4], 'credit': j[5], 'date_maturity': j[6], 'reconcile_ref':j[7], 'type':j[8], 'reconcile_partial_id':j[9], } for j in r.cr.fetchall() ]