From 7c14ec7c8331a43d60803ca38d4b4f8cb36e552d Mon Sep 17 00:00:00 2001
From: benjamin <benjamin@le-filament.com>
Date: Mon, 8 Jul 2024 13:08:04 +0200
Subject: [PATCH] [UPD] check if event has coop_id for timesheet creation

---
 models/calendar.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/models/calendar.py b/models/calendar.py
index fd5107b..0386524 100644
--- a/models/calendar.py
+++ b/models/calendar.py
@@ -315,6 +315,10 @@ class CGScopCalendar(models.Model):
                         "Le code activité UR doit être renseigné sur chaque entrée d'agenda"
                     )
                 )
+            if not event.coop_id:
+                raise UserError(
+                    _("Le contact doit être renseigné sur chaque entrée d'agenda")
+                )
             else:
                 attendee = self.env["calendar.attendee"].search(
                     [
-- 
GitLab