From cf9b44a01c40c2710436d2cd3f2018ccebf90751 Mon Sep 17 00:00:00 2001
From: "CGSCOP\\hsilvant" <hsilvant@scop.coop>
Date: Thu, 18 Jan 2024 12:07:27 +0100
Subject: [PATCH] =?UTF-8?q?Ajout=20du=20lieu=20de=20l'activit=C3=A9=20pour?=
 =?UTF-8?q?=20BFC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 models/hr_timesheet.py |  8 ++++++++
 views/hr_timesheet.xml | 12 ++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/models/hr_timesheet.py b/models/hr_timesheet.py
index e2c50ae..dd42a61 100644
--- a/models/hr_timesheet.py
+++ b/models/hr_timesheet.py
@@ -63,6 +63,14 @@ class ScopHrTimesheet(models.Model):
         string="Nb conventions régionales", compute="_compute_ur_system_nb"
     )
     is_present = fields.Boolean("Présentiel")
+    location = fields.Selection(
+        [
+            ("R", "Rendez-vous"),
+            ("D", "Déplacement"),
+            ("B", "Bureau"),
+        ],
+        string="Lieu",
+    )
     justificatifs = fields.Char(string="Justificatifs", required=False)
 
     calendar_l1 = fields.Char(
diff --git a/views/hr_timesheet.xml b/views/hr_timesheet.xml
index e1bcde2..225254a 100644
--- a/views/hr_timesheet.xml
+++ b/views/hr_timesheet.xml
@@ -108,6 +108,10 @@
                     </group>
                     <group string="Divers">
                         <field name="is_present" widget="boolean_toggle" />
+                        <field
+                            name="location"
+                            attrs="{'invisible': [('ur_id', '!=', %(cgscop_partner.riga_14233)d)]}"
+                        />
                     </group>
                     <group
                         name="DF"
@@ -178,6 +182,10 @@
                     </group>
                     <group string="Divers">
                         <field name="is_present" widget="boolean_toggle" />
+                        <field
+                            name="location"
+                            attrs="{'invisible': [('ur_id', '!=', %(cgscop_partner.riga_14233)d)]}"
+                        />
                     </group>
                     <group
                         name="DF"
@@ -244,6 +252,10 @@
                         attrs="{'readonly': [('state', 'in', ('submit', 'valid'))]}"
                     />
                     <field name="is_present" widget="boolean_toggle" />
+                        <field
+                            name="location"
+                            attrs="{'invisible': [('ur_id', '!=', %(cgscop_partner.riga_14233)d)]}"
+                        />
                 </field>
                 <field name="task_id" position="attributes">
                     <attribute name="invisible">True</attribute>
-- 
GitLab