1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/appointment_account_payment/models/account_move.py
2024-12-10 09:04:09 +07:00

18 lines
616 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class AccountMove(models.Model):
_inherit = "account.move"
calendar_booking_ids = fields.One2many("calendar.booking", "account_move_id", string="Meeting Booking")
def _invoice_paid_hook(self):
""" Override: when an invoice linked to appointment bookings is paid,
create events corresponding to the calendar bookings """
res = super()._invoice_paid_hook()
self.calendar_booking_ids._make_event_from_paid_booking()
return res