Skip to content

Commit 7bfdfd7

Browse files
committedMar 17, 2025·
[OU-ADD] hr_attendance_geolocation: Merged into hr_attendance
TT51930
1 parent 8609cbb commit 7bfdfd7

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
 

‎openupgrade_scripts/apriori.py

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
"website_sale_stock_product_configurator": "website_sale_product_configurator",
4040
# OCA/account-invoicing
4141
"account_invoice_fiscal_position_update": "account",
42+
# OCA/hr-attendance
43+
"hr_attendance_geolocation": "hr_attendance",
4244
# OCA/l10n-spain
4345
"l10n_es_irnr": "l10n_es",
4446
"l10n_es_irnr_sii": "l10n_es_aeat_sii_oca",

‎openupgrade_scripts/scripts/hr_attendance/17.0.2.0/pre-migration.py

+36
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright 2025 ForgeFlow S.L. (https://www.forgeflow.com)
2+
# Copyright 2024 Tecnativa - Víctor Martínez
23
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
34
from openupgradelib import openupgrade
45

@@ -14,6 +15,40 @@
1415
]
1516

1617

18+
def _hr_attendance_geolocation(env):
19+
"""Rename the fields if the hr_attendance_geolocation module was installed."""
20+
if openupgrade.column_exists(env.cr, "hr_attendance", "check_in_latitude"):
21+
openupgrade.rename_fields(
22+
env,
23+
[
24+
(
25+
"hr.attendance",
26+
"hr_attendance",
27+
"check_in_latitude",
28+
"in_latitude",
29+
),
30+
(
31+
"hr.attendance",
32+
"hr_attendance",
33+
"check_in_longitude",
34+
"in_longitude",
35+
),
36+
(
37+
"hr.attendance",
38+
"hr_attendance",
39+
"check_out_latitude",
40+
"out_latitude",
41+
),
42+
(
43+
"hr.attendance",
44+
"hr_attendance",
45+
"check_out_longitude",
46+
"out_longitude",
47+
),
48+
],
49+
)
50+
51+
1752
def pre_create_hr_attendance_overtime_hours(env):
1853
openupgrade.logged_query(
1954
env.cr,
@@ -42,5 +77,6 @@ def fill_res_company_attendance_from_systray(env):
4277
@openupgrade.migrate()
4378
def migrate(env, version):
4479
openupgrade.rename_xmlids(env.cr, _xmlid_renames)
80+
_hr_attendance_geolocation(env)
4581
pre_create_hr_attendance_overtime_hours(env)
4682
fill_res_company_attendance_from_systray(env)

0 commit comments

Comments
 (0)