You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
696 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2016 Binovo IT Human Project SL
  3. # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
  4. from openerp import models, fields, api
  5. class AccountAnalyticAccount(models.Model):
  6. _inherit = 'account.analytic.account'
  7. mandate_id = fields.Many2one(
  8. 'account.banking.mandate', string='Direct Debit Mandate',
  9. domain=[('state', '=', 'valid')])
  10. @api.model
  11. def _prepare_invoice_data(self, contract):
  12. invoice_vals = super(AccountAnalyticAccount, self).\
  13. _prepare_invoice_data(contract)
  14. if contract.mandate_id:
  15. invoice_vals['mandate_id'] = contract.mandate_id.id
  16. return invoice_vals