Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openupgrade_scripts/apriori.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
"website_sale_stock_product_configurator": "website_sale_product_configurator",
# OCA/account-invoicing
"account_invoice_fiscal_position_update": "account",
# OCA/hr-attendance
"hr_attendance_geolocation": "hr_attendance",
# OCA/l10n-spain
"l10n_es_irnr": "l10n_es",
"l10n_es_irnr_sii": "l10n_es_aeat_sii_oca",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2025 ForgeFlow S.L. (https://www.forgeflow.com)
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from openupgradelib import openupgrade

Expand All @@ -14,6 +15,40 @@
]


def _hr_attendance_geolocation(env):
"""Rename the fields if the hr_attendance_geolocation module was installed."""
if openupgrade.column_exists(env.cr, "hr_attendance", "check_in_latitude"):
openupgrade.rename_fields(
env,
[
(
"hr.attendance",
"hr_attendance",
"check_in_latitude",
"in_latitude",
),
(
"hr.attendance",
"hr_attendance",
"check_in_longitude",
"in_longitude",
),
(
"hr.attendance",
"hr_attendance",
"check_out_latitude",
"out_latitude",
),
(
"hr.attendance",
"hr_attendance",
"check_out_longitude",
"out_longitude",
),
],
)


def pre_create_hr_attendance_overtime_hours(env):
openupgrade.logged_query(
env.cr,
Expand Down Expand Up @@ -42,5 +77,6 @@ def fill_res_company_attendance_from_systray(env):
@openupgrade.migrate()
def migrate(env, version):
openupgrade.rename_xmlids(env.cr, _xmlid_renames)
_hr_attendance_geolocation(env)
pre_create_hr_attendance_overtime_hours(env)
fill_res_company_attendance_from_systray(env)
Loading