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