account_move.py 592 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import api, models
  4. class AccountMove(models.Model):
  5. _inherit = 'account.move'
  6. def _invoice_paid_hook(self):
  7. """ When an invoice linked to a sales order selling registrations is
  8. paid confirm attendees. Attendees should indeed not be confirmed before
  9. full payment. """
  10. res = super(AccountMove, self)._invoice_paid_hook()
  11. self.mapped('line_ids.sale_line_ids')._update_registrations(confirm=True, mark_as_paid=True)
  12. return res