File tree Expand file tree Collapse file tree 6 files changed +58
-2
lines changed Expand file tree Collapse file tree 6 files changed +58
-2
lines changed Original file line number Diff line number Diff line change @@ -270,9 +270,11 @@ def _get_user_m2o_to_empty_on_archived_employees(self):
270270 def action_time_off_dashboard (self ):
271271 action = self .env ['ir.actions.act_window' ]._for_xml_id ('hr_holidays.hr_leave_action_action_approve_department' )
272272 action ['context' ] = dict (literal_eval (action ['context' ]))
273- action ['context' ]['search_default_employee_id ' ] = self . ids
273+ action ['context' ]['show_dashboard ' ] = True
274274 action ['context' ].pop ('search_default_waiting_for_me' , False )
275275 action ['context' ].pop ('search_default_waiting_for_me_manager' , False )
276+ action ['context' ]['default_employee_id' ] = self .id
277+ action ['domain' ] = [('employee_id' , 'in' , self .ids )]
276278 return action
277279
278280 def _is_leave_user (self ):
Original file line number Diff line number Diff line change 1+ import { KanbanController } from "@web/views/kanban/kanban_controller" ;
2+ import { EventBus , useSubEnv } from "@odoo/owl" ;
3+
4+ export class TimeOffKanbanController extends KanbanController {
5+ setup ( ) {
6+ super . setup ( ) ;
7+ useSubEnv ( {
8+ timeOffBus : new EventBus ( ) ,
9+ } ) ;
10+ }
11+
12+ afterExecuteActionButton ( clickParams ) {
13+ super . afterExecuteActionButton ( clickParams ) ;
14+ this . env . timeOffBus . trigger ( "update_dashboard" ) ;
15+ }
16+ }
Original file line number Diff line number Diff line change 1+ import { KanbanRenderer } from '@web/views/kanban/kanban_renderer' ;
2+ import { TimeOffDashboard } from '../../dashboard/time_off_dashboard' ;
3+
4+ export class TimeOffKanbanRenderer extends KanbanRenderer {
5+ static template = "hr_holidays.KanbanRenderer" ;
6+ static components = {
7+ ...TimeOffKanbanRenderer . components ,
8+ TimeOffDashboard,
9+ } ;
10+ get employeeId ( ) {
11+ return this . env . model . config . context . active_id || null ;
12+ }
13+
14+ get showDashboard ( ) {
15+ return this . env . model . config . context . show_dashboard || false ;
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <templates xml : space =" preserve" >
3+ <t t-name =" hr_holidays.KanbanRenderer" >
4+ <div class =" o_timeoff_calendar d-flex flex-column" >
5+ <TimeOffDashboard t-if =" showDashboard" employeeId =" employeeId" />
6+ <t t-call =" web.KanbanRenderer" />
7+ </div >
8+ </t >
9+ </templates >
Original file line number Diff line number Diff line change 1+ import { kanbanView } from '@web/views/kanban/kanban_view' ;
2+ import { registry } from '@web/core/registry' ;
3+ import { TimeOffKanbanRenderer } from './kanban_renderer' ;
4+ import { TimeOffKanbanController } from './kanban_controller' ;
5+
6+ const TimeOffKanbanView = {
7+ ...kanbanView ,
8+ Renderer : TimeOffKanbanRenderer ,
9+ Controller : TimeOffKanbanController
10+ }
11+
12+ registry . category ( 'views' ) . add ( 'time_off_kanban_dashboard' , TimeOffKanbanView ) ;
Original file line number Diff line number Diff line change 9191 <field name =" name" >hr.leave.view.kanban</field >
9292 <field name =" model" >hr.leave</field >
9393 <field name =" arch" type =" xml" >
94- <kanban sample =" 1" class =" o_holidays_view_kanban" >
94+ <kanban sample =" 1" class =" o_holidays_view_kanban" js_class = " time_off_kanban_dashboard " >
9595 <header >
9696 <button type =" action"
9797 name =" %(hr_holidays.action_hr_leave_generate_multi_wizard)d"
You can’t perform that action at this time.
0 commit comments