Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[12.0][IMP] hr_attendance_modification_tracking: add manual column pr…
…e-install
- Loading branch information
Jaime Arroyo
committed
Jul 8, 2020
1 parent
7466252
commit 5d85630
Showing
5 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from . import models | ||
from . import tests | ||
from .hooks import pre_init_hook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright 2019 Tecnativa - Pedro M. Baeza | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
|
||
def pre_init_hook(cr): | ||
cr.execute( | ||
""" | ||
ALTER TABLE hr_attendance | ||
ADD COLUMN IF NOT EXISTS time_changed_manually BOOLEAN | ||
""" | ||
) |
11 changes: 11 additions & 0 deletions
11
hr_attendance_modification_tracking/migrations/12.0.1.2.0/pre-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from openupgradelib import openupgrade | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
openupgrade.logged_query( | ||
env.cr, """ | ||
ALTER TABLE hr_attendance | ||
ADD COLUMN IF NOT EXISTS time_changed_manually BOOLEAN | ||
""" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
Attendance changes will now be registered in the chatter. | ||
This will help prevent cheating in check-in or check-out time. | ||
List and form views also include this change information. | ||
|
||
Use cases: | ||
1) Attendances created from kiosk or check-in/check-out screens, are created as automatic. | ||
If their check-in or check-out dates are modified by any user, attendances are checked as | ||
'Manually changed'. | ||
2) Attendances created from form view will apply a 60 seconds tolerance between entered and real times. | ||
If this tolerance is surpassed, attendances are checked as 'Manually changed'. | ||
|
||
- Attendances created from kiosk or check-in/check-out screens, are created as automatic. If their check-in or check-out dates are modified by any user, attendances are checked as 'Manually changed'. | ||
- Attendances created from form view will apply a 60 seconds tolerance between entered and real times. If this tolerance is surpassed, attendances are checked as 'Manually changed'. | ||
|
||
Note: | ||
|
||
- Attendances already created won't be checked automatically on installation since it could take a large amount of time. If this is wanted it will be necessary to do it manually later. |