From 47639910a82b090ebadcb45a1131713b501e8da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=B4=D8=B1=D9=83=D8=A9=20=D8=AE=D8=A8=D9=8A=D8=B1=20?= =?UTF-8?q?=D8=A7=D9=84=D9=85=D8=AD=D8=AF=D9=88=D8=AF=D8=A9?= Date: Mon, 16 Dec 2024 07:09:17 +0300 Subject: [PATCH 1/5] Update github action file --- .github/workflows/production_pull_code.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/production_pull_code.yml b/.github/workflows/production_pull_code.yml index e140affea..6997f25cc 100644 --- a/.github/workflows/production_pull_code.yml +++ b/.github/workflows/production_pull_code.yml @@ -67,6 +67,7 @@ jobs: sudo chmod +x ${{ secrets.KAZ_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh sudo ${{ secrets.KAZ_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh ${{ secrets.KAZ_PROJECT_USER }} ${{ secrets.KAZ_STANDARD_FOLDER_PATH }} ${{ secrets.KAZ_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/} + sudo systemctl restart odoo-server-stage.service # Twahod project twahod_master_server: From e911327366a6629ac7e5da71bab07448d14ff9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=B4=D8=B1=D9=83=D8=A9=20=D8=AE=D8=A8=D9=8A=D8=B1=20?= =?UTF-8?q?=D8=A7=D9=84=D9=85=D8=AD=D8=AF=D9=88=D8=AF=D8=A9?= Date: Sun, 22 Dec 2024 12:59:56 +0300 Subject: [PATCH 2/5] Update github action file --- .github/workflows/production_pull_code.yml | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/production_pull_code.yml b/.github/workflows/production_pull_code.yml index 6997f25cc..51575aca8 100644 --- a/.github/workflows/production_pull_code.yml +++ b/.github/workflows/production_pull_code.yml @@ -13,6 +13,8 @@ on: - Helpdesk-Khabir-Project - King-AbdelAziz-Library-Project - Twahod-Project + - Trahum-Production-Project + - Trahum-Stage-Project jobs: # Cyber Project @@ -82,6 +84,31 @@ jobs: sudo chmod +x ${{ secrets.TWAHOD_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh sudo ${{ secrets.TWAHOD_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh ${{ secrets.TWAHOD_PROJECT_USER }} ${{ secrets.TWAHOD_STANDARD_FOLDER_PATH }} ${{ secrets.TWAHOD_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/} +# Trahum prod project + trahum_master_prod_server: + name: Deploy to Trahum Master + runs-on: trahum-prod-client-project-runner + if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'Trahum-Production-Project' && (github.ref == 'refs/heads/master_odex-event' || github.ref == 'refs/heads/master_odex25_accounting' || github.ref == 'refs/heads/master_odex25_base' || github.ref == 'refs/heads/master_odex25_dms' || github.ref == 'refs/heads/master_odex25_fleet' || github.ref == 'refs/heads/master_odex25_ENSAN' || github.ref == 'refs/heads/master_odex25_hr' || github.ref == 'refs/heads/master_odex25_inventory' || github.ref == 'refs/heads/master_odex25_maintenance' || github.ref == 'refs/heads/master_odex25_mobile' || github.ref == 'refs/heads/master_odex25_pos' || github.ref == 'refs/heads/master_odex25_project' || github.ref == 'refs/heads/master_odex25_purchase' || github.ref == 'refs/heads/master_odex25_realstate' || github.ref == 'refs/heads/master_odex25_sales' || github.ref == 'refs/heads/master_odex25_survey' || github.ref == 'refs/heads/master_odex25_transactions' || github.ref == 'refs/heads/master_odex25_website' || github.ref == 'refs/heads/master_openeducat_erp-14.0.1.0' || github.ref == 'refs/heads/master_odex25_ensan') + steps: + - name: Checkout And Restart Project + run: | + echo "** [INFO] Running on branch --> ${GITHUB_REF#refs/heads/}" + + sudo chmod +x ${{ secrets.TRAHUM_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh + sudo ${{ secrets.TRAHUM_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh ${{ secrets.TRAHUM_PROJECT_USER }} ${{ secrets.TRAHUM_STANDARD_FOLDER_PATH }} ${{ secrets.TRAHUM_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/} + +# Trahum stg project + trahum_master_stg_server: + name: Deploy to Trahum Master + runs-on: trahum-stg-client-project-runner + if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'Trahum-Stage-Project' && (github.ref == 'refs/heads/master_odex-event' || github.ref == 'refs/heads/master_odex25_accounting' || github.ref == 'refs/heads/master_odex25_base' || github.ref == 'refs/heads/master_odex25_dms' || github.ref == 'refs/heads/master_odex25_fleet' || github.ref == 'refs/heads/master_odex25_ENSAN' || github.ref == 'refs/heads/master_odex25_hr' || github.ref == 'refs/heads/master_odex25_inventory' || github.ref == 'refs/heads/master_odex25_maintenance' || github.ref == 'refs/heads/master_odex25_mobile' || github.ref == 'refs/heads/master_odex25_pos' || github.ref == 'refs/heads/master_odex25_project' || github.ref == 'refs/heads/master_odex25_purchase' || github.ref == 'refs/heads/master_odex25_realstate' || github.ref == 'refs/heads/master_odex25_sales' || github.ref == 'refs/heads/master_odex25_survey' || github.ref == 'refs/heads/master_odex25_transactions' || github.ref == 'refs/heads/master_odex25_website' || github.ref == 'refs/heads/master_openeducat_erp-14.0.1.0' || github.ref == 'refs/heads/master_odex25_ensan') + steps: + - name: Checkout And Restart Project + run: | + echo "** [INFO] Running on branch --> ${GITHUB_REF#refs/heads/}" + + sudo chmod +x ${{ secrets.TRAHUM_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh + sudo ${{ secrets.TRAHUM_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh ${{ secrets.TRAHUM_PROJECT_USER }} ${{ secrets.TRAHUM_STANDARD_FOLDER_PATH }} ${{ secrets.TRAHUM_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/} # if: github.event_name == 'workflow_dispatch' && (github.ref == 'refs/heads/master_odex-event' || github.ref == 'refs/heads/master_odex25_accounting' || github.ref == 'refs/heads/master_odex25_base' || github.ref == 'refs/heads/master_odex25_dms' || github.ref == 'refs/heads/master_odex25_fleet' || github.ref == 'refs/heads/master_odex25_ENSAN' || github.ref == 'refs/heads/master_odex25_hr' || github.ref == 'refs/heads/master_odex25_inventory' || github.ref == 'refs/heads/master_odex25_maintenance' || github.ref == 'refs/heads/master_odex25_mobile' || github.ref == 'refs/heads/master_odex25_pos' || github.ref == 'refs/heads/master_odex25_project' || github.ref == 'refs/heads/master_odex25_purchase' || github.ref == 'refs/heads/master_odex25_realstate' || github.ref == 'refs/heads/master_odex25_sales' || github.ref == 'refs/heads/master_odex25_survey' || github.ref == 'refs/heads/master_odex25_transactions' || github.ref == 'refs/heads/master_odex25_website' || github.ref == 'refs/heads/master_openeducat_erp-14.0.1.0' || github.ref == 'refs/heads/master_odex25_ensan') From ad82af937d51c1ee7da18240e07f8e430e486ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=B4=D8=B1=D9=83=D8=A9=20=D8=AE=D8=A8=D9=8A=D8=B1=20?= =?UTF-8?q?=D8=A7=D9=84=D9=85=D8=AD=D8=AF=D9=88=D8=AF=D8=A9?= Date: Wed, 25 Dec 2024 21:29:30 +0300 Subject: [PATCH 3/5] Update github action file --- .github/workflows/dev-preprod-servers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev-preprod-servers.yml b/.github/workflows/dev-preprod-servers.yml index 2f5b76802..d86cbb29d 100644 --- a/.github/workflows/dev-preprod-servers.yml +++ b/.github/workflows/dev-preprod-servers.yml @@ -66,7 +66,7 @@ jobs: run: | sudo chmod +x /home/${{ secrets.CLIENT_USER }}/scripts/pull/preprod_pull_standard_code.sh sudo /home/${{ secrets.CLIENT_USER }}/scripts/pull/preprod_pull_standard_code.sh - sudo systemctl restart ${{ secrets.ENSAN_APP_PREPROD_SERVICE }} ${{ secrets.ODEX25_GENERAL_PREPROD_SERVICE }} ${{ secrets.ODEX25_STANDARD_PREPROD_SERVICE }} ${{ secrets.TWAHOD_APP_PREPROD_SERVICE }} ${{ secrets.ODEX25_DEMO_PREPROD_SERVICE }} ${{ secrets.HELPDESK_PREPROD_SERVICE }} ${{ secrets.TRAHUM_PREPROD_SERVICE }} ${{ secrets.CYBER_APP_PREPROD_SERVICE }} + sudo systemctl restart ${{ secrets.ENSAN_APP_PREPROD_SERVICE }} ${{ secrets.ODEX25_GENERAL_PREPROD_SERVICE }} ${{ secrets.ODEX25_STANDARD_PREPROD_SERVICE }} ${{ secrets.TWAHOD_APP_PREPROD_SERVICE }} ${{ secrets.ODEX25_DEMO_PREPROD_SERVICE }} ${{ secrets.HELPDESK_PREPROD_SERVICE }} ${{ secrets.CYBER_APP_PREPROD_SERVICE }} if [ $? -eq 0 ]; then echo "** [INFO] "PREPROD" services have been restarted." else @@ -82,7 +82,7 @@ jobs: run: | sudo chmod +x /home/${{ secrets.CLIENT_USER }}/scripts/pull/dev_pull_standard_code.sh sudo /home/${{ secrets.CLIENT_USER }}/scripts/pull/dev_pull_standard_code.sh - sudo systemctl restart ${{ secrets.ENSAN_APP_TEST_SERVICE }} ${{ secrets.ODEX25_GENERAL_TEST_SERVICE }} ${{ secrets.ODEX25_STANDARD_TEST_SERVICE }} ${{ secrets.TWAHOD_APP_TEST_SERVICE }} ${{ secrets.HELPDESK_TEST_SERVICE }} ${{ secrets.KAZ_LIBRARY_TEST_SERVICE }} ${{ secrets.TRAHUM_TEST_SERVICE }} ${{ secrets.CYBER_APP_TEST_SERVICE }} + sudo systemctl restart ${{ secrets.ENSAN_APP_TEST_SERVICE }} ${{ secrets.ODEX25_GENERAL_TEST_SERVICE }} ${{ secrets.ODEX25_STANDARD_TEST_SERVICE }} ${{ secrets.TWAHOD_APP_TEST_SERVICE }} ${{ secrets.HELPDESK_TEST_SERVICE }} ${{ secrets.KAZ_LIBRARY_TEST_SERVICE }} ${{ secrets.CYBER_APP_TEST_SERVICE }} if [ $? -eq 0 ]; then echo "** [INFO] "DEV" services have been restarted." else From f95d82170eeb11f2d1d4b788fe1f6fc188cafa58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=B4=D8=B1=D9=83=D8=A9=20=D8=AE=D8=A8=D9=8A=D8=B1=20?= =?UTF-8?q?=D8=A7=D9=84=D9=85=D8=AD=D8=AF=D9=88=D8=AF=D8=A9?= Date: Wed, 25 Dec 2024 21:31:21 +0300 Subject: [PATCH 4/5] Update github action file --- .github/workflows/production_pull_code.yml | 27 ---------------------- 1 file changed, 27 deletions(-) diff --git a/.github/workflows/production_pull_code.yml b/.github/workflows/production_pull_code.yml index 51575aca8..6997f25cc 100644 --- a/.github/workflows/production_pull_code.yml +++ b/.github/workflows/production_pull_code.yml @@ -13,8 +13,6 @@ on: - Helpdesk-Khabir-Project - King-AbdelAziz-Library-Project - Twahod-Project - - Trahum-Production-Project - - Trahum-Stage-Project jobs: # Cyber Project @@ -84,31 +82,6 @@ jobs: sudo chmod +x ${{ secrets.TWAHOD_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh sudo ${{ secrets.TWAHOD_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh ${{ secrets.TWAHOD_PROJECT_USER }} ${{ secrets.TWAHOD_STANDARD_FOLDER_PATH }} ${{ secrets.TWAHOD_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/} -# Trahum prod project - trahum_master_prod_server: - name: Deploy to Trahum Master - runs-on: trahum-prod-client-project-runner - if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'Trahum-Production-Project' && (github.ref == 'refs/heads/master_odex-event' || github.ref == 'refs/heads/master_odex25_accounting' || github.ref == 'refs/heads/master_odex25_base' || github.ref == 'refs/heads/master_odex25_dms' || github.ref == 'refs/heads/master_odex25_fleet' || github.ref == 'refs/heads/master_odex25_ENSAN' || github.ref == 'refs/heads/master_odex25_hr' || github.ref == 'refs/heads/master_odex25_inventory' || github.ref == 'refs/heads/master_odex25_maintenance' || github.ref == 'refs/heads/master_odex25_mobile' || github.ref == 'refs/heads/master_odex25_pos' || github.ref == 'refs/heads/master_odex25_project' || github.ref == 'refs/heads/master_odex25_purchase' || github.ref == 'refs/heads/master_odex25_realstate' || github.ref == 'refs/heads/master_odex25_sales' || github.ref == 'refs/heads/master_odex25_survey' || github.ref == 'refs/heads/master_odex25_transactions' || github.ref == 'refs/heads/master_odex25_website' || github.ref == 'refs/heads/master_openeducat_erp-14.0.1.0' || github.ref == 'refs/heads/master_odex25_ensan') - steps: - - name: Checkout And Restart Project - run: | - echo "** [INFO] Running on branch --> ${GITHUB_REF#refs/heads/}" - - sudo chmod +x ${{ secrets.TRAHUM_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh - sudo ${{ secrets.TRAHUM_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh ${{ secrets.TRAHUM_PROJECT_USER }} ${{ secrets.TRAHUM_STANDARD_FOLDER_PATH }} ${{ secrets.TRAHUM_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/} - -# Trahum stg project - trahum_master_stg_server: - name: Deploy to Trahum Master - runs-on: trahum-stg-client-project-runner - if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'Trahum-Stage-Project' && (github.ref == 'refs/heads/master_odex-event' || github.ref == 'refs/heads/master_odex25_accounting' || github.ref == 'refs/heads/master_odex25_base' || github.ref == 'refs/heads/master_odex25_dms' || github.ref == 'refs/heads/master_odex25_fleet' || github.ref == 'refs/heads/master_odex25_ENSAN' || github.ref == 'refs/heads/master_odex25_hr' || github.ref == 'refs/heads/master_odex25_inventory' || github.ref == 'refs/heads/master_odex25_maintenance' || github.ref == 'refs/heads/master_odex25_mobile' || github.ref == 'refs/heads/master_odex25_pos' || github.ref == 'refs/heads/master_odex25_project' || github.ref == 'refs/heads/master_odex25_purchase' || github.ref == 'refs/heads/master_odex25_realstate' || github.ref == 'refs/heads/master_odex25_sales' || github.ref == 'refs/heads/master_odex25_survey' || github.ref == 'refs/heads/master_odex25_transactions' || github.ref == 'refs/heads/master_odex25_website' || github.ref == 'refs/heads/master_openeducat_erp-14.0.1.0' || github.ref == 'refs/heads/master_odex25_ensan') - steps: - - name: Checkout And Restart Project - run: | - echo "** [INFO] Running on branch --> ${GITHUB_REF#refs/heads/}" - - sudo chmod +x ${{ secrets.TRAHUM_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh - sudo ${{ secrets.TRAHUM_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh ${{ secrets.TRAHUM_PROJECT_USER }} ${{ secrets.TRAHUM_STANDARD_FOLDER_PATH }} ${{ secrets.TRAHUM_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/} # if: github.event_name == 'workflow_dispatch' && (github.ref == 'refs/heads/master_odex-event' || github.ref == 'refs/heads/master_odex25_accounting' || github.ref == 'refs/heads/master_odex25_base' || github.ref == 'refs/heads/master_odex25_dms' || github.ref == 'refs/heads/master_odex25_fleet' || github.ref == 'refs/heads/master_odex25_ENSAN' || github.ref == 'refs/heads/master_odex25_hr' || github.ref == 'refs/heads/master_odex25_inventory' || github.ref == 'refs/heads/master_odex25_maintenance' || github.ref == 'refs/heads/master_odex25_mobile' || github.ref == 'refs/heads/master_odex25_pos' || github.ref == 'refs/heads/master_odex25_project' || github.ref == 'refs/heads/master_odex25_purchase' || github.ref == 'refs/heads/master_odex25_realstate' || github.ref == 'refs/heads/master_odex25_sales' || github.ref == 'refs/heads/master_odex25_survey' || github.ref == 'refs/heads/master_odex25_transactions' || github.ref == 'refs/heads/master_odex25_website' || github.ref == 'refs/heads/master_openeducat_erp-14.0.1.0' || github.ref == 'refs/heads/master_odex25_ensan') From bc18b380e3089681ec5402047a21d5567f75414e Mon Sep 17 00:00:00 2001 From: Samir Ladoui Date: Mon, 10 Feb 2025 10:18:08 +0100 Subject: [PATCH 5/5] [UPD] odex_mobile: possibility to create multiple sign in --- .../controllers/rest_api_v2/attendance.py | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/odex25_mobile/odex_mobile/controllers/rest_api_v2/attendance.py b/odex25_mobile/odex_mobile/controllers/rest_api_v2/attendance.py index 59666f77f..8b4355316 100644 --- a/odex25_mobile/odex_mobile/controllers/rest_api_v2/attendance.py +++ b/odex25_mobile/odex_mobile/controllers/rest_api_v2/attendance.py @@ -202,38 +202,38 @@ class AttendanceController(http.Controller): order='name desc', limit=1) system_checkout = json.loads(body.get('system_checkout')) if 'system_checkout' in body else False - if not rec or rec and rec.action != body.get('action'): - attendance = http.request.env['attendance.attendance'].create({ - 'employee_id':employee.id, - 'action':body.get('action'), - 'action_type':"system_checkout" if body.get('action') == 'sign_out' and system_checkout == True else 'application', - 'name': fields.datetime.now(), - # 'device_id':body.get('device_id'), - 'zone':zone.zone if zone else "%s,%s" % (body.get('longitude'), body.get('latitude')), - 'longitude': body.get('longitude'), - 'latitude':body.get('latitude'), - }) - if attendance: - if body.get('action') == 'sign_out' and system_checkout == True: - msg = (_("System Force Sign out Due to Change Location Permission ")) - subject = (_("System Force Sign out")) - self.send_msg(employee, msg, subject) + # if not rec or rec and rec.action != body.get('action'): + attendance = http.request.env['attendance.attendance'].create({ + 'employee_id':employee.id, + 'action':body.get('action'), + 'action_type':"system_checkout" if body.get('action') == 'sign_out' and system_checkout == True else 'application', + 'name': fields.datetime.now(), + # 'device_id':body.get('device_id'), + 'zone':zone.zone if zone else "%s,%s" % (body.get('longitude'), body.get('latitude')), + 'longitude': body.get('longitude'), + 'latitude':body.get('latitude'), + }) + if attendance: + if body.get('action') == 'sign_out' and system_checkout == True: + msg = (_("System Force Sign out Due to Change Location Permission ")) + subject = (_("System Force Sign out")) + self.send_msg(employee, msg, subject) - date = attendance.name.time() - data = { - "id": attendance.id, - "action": attendance.action, - "attendance_status": attendance.action, - "time": str(date), - "zone": attendance.zone, - "longitude": attendance.longitude, - "latitude": attendance.latitude, - "range": zone.allowed_range if zone else False, - } - msg = (_("Check Out successfully")) if body.get('action') == 'sign_out' else (_("Check in successfully")) - else: - msg = (_("Check Fail Due To Duplication")) - data = {} + date = attendance.name.time() + data = { + "id": attendance.id, + "action": attendance.action, + "attendance_status": attendance.action, + "time": str(date), + "zone": attendance.zone, + "longitude": attendance.longitude, + "latitude": attendance.latitude, + "range": zone.allowed_range if zone else False, + } + msg = (_("Check Out successfully")) if body.get('action') == 'sign_out' else (_("Check in successfully")) + # else: + # msg = (_("Check Fail Due To Duplication")) + # data = {} # Reset last_active_time when the employee signed out if body.get('action') == 'sign_out': employee.last_active_time = False