diff --git a/addons/hr_attendance/static/src/components/attendance_menu/attendance_menu.js b/addons/hr_attendance/static/src/components/attendance_menu/attendance_menu.js index 885637e5d07..0c727b05d7a 100644 --- a/addons/hr_attendance/static/src/components/attendance_menu/attendance_menu.js +++ b/addons/hr_attendance/static/src/components/attendance_menu/attendance_menu.js @@ -52,19 +52,25 @@ export class ActivityMenu extends Component { } async signInOut() { - navigator.geolocation.getCurrentPosition( - async ({coords: {latitude, longitude}}) => { - await this.rpc("/hr_attendance/systray_check_in_out", { - latitude, - longitude - }) - await this.searchReadEmployee() - }, - async err => { - await this.rpc("/hr_attendance/systray_check_in_out") - await this.searchReadEmployee() - } - ) + if(navigator.geolocation){ + navigator.geolocation.getCurrentPosition( + async ({coords: {latitude, longitude}}) => { + await this.rpc("/hr_attendance/systray_check_in_out", { + latitude, + longitude + }) + await this.searchReadEmployee() + }, + async err => { + await this.rpc("/hr_attendance/systray_check_in_out") + await this.searchReadEmployee() + } + ) + } + else{ + await this.rpc("/hr_attendance/systray_check_in_out") + await this.searchReadEmployee() + } } }