account_payment_term.py 565 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. from openerp.http import request as r
  3. def get_payment_terms():
  4. domain = [
  5. ('active', '=', True)
  6. ]
  7. return [
  8. {
  9. 'id': pt.id,
  10. 'name': pt.name,
  11. 'displayName': pt.display_name,
  12. 'lines': [{
  13. 'id': l.id,
  14. 'days': l.days,
  15. 'days2': l.days2,
  16. 'value': l.value,
  17. 'valueAmount': l.value_amount
  18. } for l in pt.line_ids]
  19. } for pt in r.env['account.payment.term'].search(domain)
  20. ]