1234567891011121314151617181920212223242526272829 |
- from openerp import api, fields, models
- class AccountPaymentTerm(models.Model):
- _inherit = 'account.payment.term'
- @api.model
- def get_account_payment_terms(self):
- domain = [('active', '=', True)]
- terms = []
- for term in self.env['account.payment.term'].search(domain):
- lines = []
- for line in term.line_ids:
- lines.append({
- 'id': line.id,
- 'display_name': line.display_name,
- 'days': line.days,
- 'value_amount': line.value_amount
- })
- terms.append({
- 'id': term.id,
- 'name': term.name,
- 'display_name': term.display_name,
- 'lines': lines
- })
- return terms
|