Skip to content

[19.0][MIG] hr_attendance#5705

Open
hbrunn wants to merge 1 commit into
OCA:19.0from
hbrunn:19.0-hr_attendance
Open

[19.0][MIG] hr_attendance#5705
hbrunn wants to merge 1 commit into
OCA:19.0from
hbrunn:19.0-hr_attendance

Conversation

@hbrunn

@hbrunn hbrunn commented Jun 9, 2026

Copy link
Copy Markdown
Member

No description provided.

@hbrunn hbrunn added this to the 19.0 milestone Jun 9, 2026
@hbrunn

hbrunn commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

/ocabot migration hr_attendance

Depends on :

@legalsylvain

This comment was marked as duplicate.

@hbrunn

This comment was marked as off-topic.

@legalsylvain

This comment was marked as off-topic.

@hbrunn

This comment was marked as off-topic.

@legalsylvain

This comment was marked as off-topic.

@hbrunn

This comment was marked as off-topic.

@legalsylvain

This comment was marked as off-topic.

@hbrunn

hbrunn commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

@legalsylvain done in #5745, now setting our whole discussion as off-topic

@legalsylvain

Copy link
Copy Markdown
Contributor

@legalsylvain done in #5745, now setting our whole discussion as off-topic

thanks a lot for this Job. I manually run the script a last time for the V19. new 19 PR should be handled by your script.


@openupgrade.migrate()
def migrate(env, version):
openupgrade.load_data(env, "hr_attendance", "19.0.2.0/noupdate_changes.xml")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For letting the record as it's in 19, we should remove the group hr_attendance.group_hr_attendance_manager from hr_attendance.hr_attendance_rule_attendance_admin record.

---Models in module 'hr_attendance'---
obsolete model hr.attendance.overtime (renamed to hr.attendance.overtime.line)
new model hr.attendance.overtime.line (renamed from hr.attendance.overtime)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why adding these empty lines that makes the reading harder? I think the comment should be together with the analysis lines block.


# NOTHING TO DO

hr_attendance / hr.attendance / in_location (char) : NEW

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reorganize this line into in_city DEL comment for seeing both together and to understand the change.

# date is required in v19, fill with create_date if empty, possibly wrong
env.cr.execute(
f"""
UPDATE hr_attendance_overtime_line SET date=(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not get it the same from the nearest attendance record?

SQL_EMPLOYEE2TZ = """
(
SELECT
hr_employee.id employee_id,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find you new SQL style a bit difficult to read, and very vertical scroll intensive. Either indent the lines after the command (SELECT, FROM, etc), or put them in the same line as always.

WHERE
hr_attendance.employee_id=hr_attendance_overtime_line.employee_id
AND
hr_attendance.date=hr_attendance_overtime_line.date

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part may not fit according current code, and even more, we may have more than one record for the same date.

"""
Pre-fill hr.attendance#date
"""
openupgrade.add_fields(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why using add_fields instead of add_columns or a simply ALTER TABLE?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants