res_currency.py 641 B

1234567891011121314151617181920212223242526272829
  1. from openerp.http import request as r
  2. def get_res_currency():
  3. query = '''
  4. SELECT
  5. id,
  6. name,
  7. local_name,
  8. symbol,
  9. decimal_separator,
  10. thousands_separator,
  11. decimal_places
  12. FROM res_currency
  13. WHERE active = True
  14. '''
  15. r.cr.execute(query)
  16. return [
  17. {
  18. 'id': j[0],
  19. 'name': j[1],
  20. 'local_name': j[2],
  21. 'symbol': j[3],
  22. 'decimal_separator': j[4],
  23. 'thousands_separator': j[5],
  24. 'decimal_places': j[6],
  25. } for j in r.cr.fetchall()
  26. ]