[14.0][ADD] google_calendar_usability

This commit is contained in:
Kevin Khao
2021-01-18 13:41:24 +01:00
parent 20af679569
commit d4272eff9c
6 changed files with 90 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
# Copyright 2021 Akretion (http://www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class Meeting(models.Model):
_inherit = "calendar.event"
def unlink(self):
to_archive = self.filtered(lambda r: r.google_id and r.active)
if to_archive:
to_archive.write({"active": False})
to_unlink = self - to_archive
super(Meeting, to_unlink).unlink()