From c4e2c385587854886c23cb90364878f88777da9f Mon Sep 17 00:00:00 2001
From: benjamin <benjamin@le-filament.com>
Date: Wed, 21 Jul 2021 10:40:17 +0200
Subject: [PATCH] [fix] context on action for default employee

---
 views/hr_timesheet.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/views/hr_timesheet.xml b/views/hr_timesheet.xml
index 98f7216..354b8d1 100644
--- a/views/hr_timesheet.xml
+++ b/views/hr_timesheet.xml
@@ -49,6 +49,7 @@
                 <xpath expr="//form/sheet/group" position="after">
                     <group string="Activité">
                         <field name="ur_id" options="{'no_open': True, 'no_create': True}" groups="cgscop_partner.group_cg_administrator"/>
+                        <field name="employee_id" required="True" readonly="1"/>
                         <field name="employee_id" options="{'no_open': True, 'no_create': True}" required="True" groups="hr_timesheet.group_timesheet_manager"/>
                         <field name="date"/>
                         <field name="project_id" required="True" options="{'no_open': True, 'no_create': True}" string="Code activité UR" />
@@ -187,7 +188,7 @@
         <record id="hr_timesheet.act_hr_timesheet_line" model="ir.actions.act_window">
             <field name="name">Mes lignes de temps</field>
             <field name="view_mode">calendar,tree,form,pivot</field>
-            <field name="context">{'search_default_no_report': 1}</field>
+            <field name="context">{'search_default_no_report': 1, 'default_employee_id': 1}</field>
             <field name="view_ids" eval="[(5, 0, 0),
                 (0, 0, {'view_mode': 'tree', 'sequence': 5, 'view_id': ref('cgscop_timesheet.view_cgscop_hr_timesheet_line_tree')}),
                 (0, 0, {'view_mode': 'calendar', 'sequence': 10, 'view_id': ref('cgscop_timesheet.view_cgscop_hr_timesheet_line_calendar')}),
-- 
GitLab