Skip to content

Commit

Permalink
Disable default partner_ids during calendar event creation
Browse files Browse the repository at this point in the history
  • Loading branch information
moctarjallo committed Nov 29, 2023
1 parent 7747716 commit 061048e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions hr_holidays_public/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
from . import hr_leave_type
from . import hr_holidays_public
from . import resource_calendar
from . import calendar_event
14 changes: 14 additions & 0 deletions hr_holidays_public/models/calendar_event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2023 XCG-CONSULTING - Moctar Diallo <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class CalendarEvent(models.Model):
_inherit = "calendar.event"

def default_get(self, fields_list):
defaults = super().default_get(fields_list)
if "partner_ids" in defaults:
defaults["partner_ids"] = False
return defaults

0 comments on commit 061048e

Please sign in to comment.