# -*- coding: utf-8 -*- from openerp.http import request _MODEL = 'account.payment.term' ''' ''' def get_payment_terms(): domain = [ ('active', '=', True) ] return [ { 'id': payment_term.id, 'name': payment_term.display_name, 'lines': [ { 'id': line.id, 'days': line.days, 'days2': line.days2, 'value': line.value, 'valueAmount': line.value_amount } for line in payment_term.line_ids ] } for payment_term in request.env[_MODEL].search(domain) ]