account_payment_term.py 668 B

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