From e8358b050bcf09d3efbd8f3e73eebbb1b235fd74 Mon Sep 17 00:00:00 2001 From: raman Date: Wed, 5 Feb 2025 18:46:53 +0530 Subject: [PATCH] dashboard fix --- .../static/src/js/profile_component.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/addons_extensions/hr_emp_dashboard/static/src/js/profile_component.js b/addons_extensions/hr_emp_dashboard/static/src/js/profile_component.js index 12dd660e0..15795ac2d 100644 --- a/addons_extensions/hr_emp_dashboard/static/src/js/profile_component.js +++ b/addons_extensions/hr_emp_dashboard/static/src/js/profile_component.js @@ -44,6 +44,20 @@ export class NetflixProfileContainer extends Component { this.fetchEmployeeData(); }); } + hr_timesheets() { + this.action.doAction({ + name: "Timesheets", + type: 'ir.actions.act_window', + res_model: 'account.analytic.line', + view_mode: 'list,form', + views: [[false, 'list'], [false, 'form']], + context: { + 'search_default_month': true, + }, + domain: [['employee_id.user_id','=', this.props.action.context.user_id]], + target: 'current' + }) + } attendance_sign_in_out() { if (this.state.login_employee.attendance_state == 'checked_out') { this.state.login_employee.attendance_state = 'checked_in' @@ -145,7 +159,7 @@ export class NetflixProfileContainer extends Component { const employee = employeeData[0]; attendanceLines.forEach(line => { let createDate = new Date(line.create_date); - line.create_date = createDate.toISOString().split('T')[0]; // Format as 'YYYY-MM-DD' + line.create_date = createDate.toLocaleDateString('en-IN', { timeZone: 'Asia/Kolkata' }); // Format as 'YYYY-MM-DD' let checkIn = new Date(line.check_in + 'Z'); line.check_in = checkIn.toLocaleTimeString([], {hour: '2-digit', minute: '2-digit', timeZone:'Asia/Kolkata'}); // Format as 'HH:MM' let checkOut = new Date(line.check_out + 'Z');