account_move.py 555 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import 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, update booths accordingly as they are booked when invoice is paid.
  9. """
  10. res = super(AccountMove, self)._invoice_paid_hook()
  11. self.mapped('line_ids.sale_line_ids')._update_event_booths(set_paid=True)
  12. return res