account_move_line_partial_reconcile.py 642 B

12345678910111213141516171819202122232425
  1. # -*- coding: utf-8 -*-
  2. from openerp.http import request as r
  3. def get_account_move_line_partial_reconcile():
  4. query = '''
  5. SELECT
  6. journal.id,
  7. line.reconcile_partial_id,
  8. line.credit
  9. FROM account_journal AS journal
  10. LEFT JOIN account_move_line AS line
  11. ON line.journal_id = journal.id
  12. WHERE journal.type in ('bank','cash')
  13. AND line.reconcile_partial_id IS NOT NULL
  14. '''
  15. r.cr.execute(query)
  16. return [
  17. {
  18. 'journal_id': j[0],
  19. 'reconcile_partial_id': j[1],
  20. 'amount': j[2],
  21. } for j in r.cr.fetchall()
  22. ]