From 451592fc9fc9143122343db7abe536dd8b24c278 Mon Sep 17 00:00:00 2001
From: Benjamin <benjamin@le-filament.com>
Date: Thu, 5 Mar 2020 18:32:52 +0100
Subject: [PATCH] [cgscop #21] ajout domaine ur_id sur contact

---
 models/calendar.py | 2 ++
 views/calendar.xml | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/models/calendar.py b/models/calendar.py
index e476448..fda0c8e 100644
--- a/models/calendar.py
+++ b/models/calendar.py
@@ -18,6 +18,8 @@ class CGScopCalendar(models.Model):
     def _default_ur(self):
         return self.env['res.company']._ur_default_get()
 
+    partner_ids = fields.Many2many(domain=[
+        ('user_ids', '!=', False)])
     type = fields.Selection([
         ('outside', 'Extérieur'),
         ('ur', 'UR'),
diff --git a/views/calendar.xml b/views/calendar.xml
index aa6008d..613d276 100644
--- a/views/calendar.xml
+++ b/views/calendar.xml
@@ -66,7 +66,7 @@
                     <group name="event_info" col="1">
                         <group>
                             <field name="project_id" options="{'no_open': True, 'no_create': True}"/>
-                            <field name="coop_id" options="{'no_open': True, 'no_create': True}"/>
+                            <field name="coop_id" options="{'no_open': True, 'no_create': True}" domain="[('ur_id', '=', ur_id)]"/>
                             <field name="ur_id" invisible="1"/>
                             <field 
                                 name="partner_ids"
-- 
GitLab