Skip to content

Conversation

@eduezerouali-tecnativa
Copy link

cc @Tecanativa TT59859
ping @pedrobaeza @juancarlosonate-tecnativa @david-banon-tecnativa

This module allows tracking employee rest times (breaks) that are included in the employee’s working time.

@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-hr_attendance_rest_time_include branch 2 times, most recently from 96d925f to 156f5c5 Compare December 22, 2025 10:20
@pedrobaeza pedrobaeza added this to the 15.0 milestone Dec 22, 2025
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

@eduezerouali-tecnativa you have to add at attendance reason level, when being "Sign out" one, a check for saying if it's a rest time included in the attendance.

@pedrobaeza
Copy link
Member

pedrobaeza commented Dec 22, 2025

I see you have added it as a configuration option inside settings, but it should be at attendance reason level, as it can be more than one reason.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Apart from the comments inline, include in the ROADMAP that this module is not totally compatible with hr_attendance_geolocation, as I have seen that the sign out coordinates are stored in the main attendance record while signing out the rest time. On upper versions, where the geolocation is included, we will need to check how to make it compatible.

class HrAttendance(models.Model):
_inherit = "hr.attendance"

hr_attendance_rest_time = fields.One2many(
Copy link
Member

Choose a reason for hiding this comment

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

This is inside hr.attendance, so the prefix hr_attendance is useless, redundant and takes a lot of space, and on the other side, use _ids suffix convention for o2m:

Suggested change
hr_attendance_rest_time = fields.One2many(
rest_time_ids = fields.One2many(

Comment on lines 7 to 8
_name = "hr.attendance.rest_time"
_inherit = "hr.attendance"
Copy link
Member

Choose a reason for hiding this comment

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

For indicating the intention of inheritance with new model, better to put before _inherit and then _name:

Suggested change
_name = "hr.attendance.rest_time"
_inherit = "hr.attendance"
_inherit = "hr.attendance"
_name = "hr.attendance.rest_time"

def _attendance_action_change(self):
self.ensure_one()
RestTime = self.env["hr.attendance.rest_time"]

Copy link
Member

Choose a reason for hiding this comment

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

Don't add empty lines inside a method (it applies to all the code).

@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-hr_attendance_rest_time_include branch 4 times, most recently from 8e897da to 35c4406 Compare December 22, 2025 12:40
@eduezerouali-tecnativa
Copy link
Author

All changes apply !

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Apart from the inline comments, we are almost there. Some other changes:

  • It seems the original chatter is being rewritten when checking out/in the rest time:

    Image
  • There's no navigation nor visualization of the rest time attendances. Put a button next to the rest time column to go to them, and also a smart-button on the main attendance record, both only visible when there are rest time attendances.

@eduezerouali-tecnativa
Copy link
Author

Small comments already fix (not push yet). About the chatter, this is only available if you install hr_attendance_modification_tracking in upper odoo version is directly into core. Should we add a glue module to fix that?

@pedrobaeza
Copy link
Member

About the chatter, this is only available if you install hr_attendance_modification_tracking in upper odoo version is directly into core. Should we add a glue module to fix that?

No need of the glue module then, but also a mention in the ROADMAP.

@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-hr_attendance_rest_time_include branch from 35c4406 to 5f4ef82 Compare December 23, 2025 11:49
@eduezerouali-tecnativa
Copy link
Author

add changes, plus the mention to ROADMAP

@pedrobaeza
Copy link
Member

Last fix:

image

@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-hr_attendance_rest_time_include branch from 5f4ef82 to e875458 Compare December 24, 2025 10:10
@eduezerouali-tecnativa
Copy link
Author

ping @pedrobaeza

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Can you put another icon like the clock for the button to go the the breaks?

@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-hr_attendance_rest_time_include branch from e875458 to 0f2d31d Compare December 29, 2025 14:50
@eduezerouali-tecnativa
Copy link
Author

done

@eduezerouali-tecnativa
Copy link
Author

added Spanish translations, not 100% if it goes in an other commit or i should just squash them

@pedrobaeza
Copy link
Member

It should go in the same commit as the other, and anyway, if in a separate commit, it shouldn't be [ADD], as that's just for adding modules, but squash it as said.

@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-hr_attendance_rest_time_include branch from 3071d7c to 8199ec8 Compare December 30, 2025 12:01
@eduezerouali-tecnativa
Copy link
Author

It should go in the same commit as the other, and anyway, if in a separate commit, it shouldn't be [ADD], as that's just for adding modules, but squash it as said.

okay, i got that from an other module commit as reference to add translation without using weblate. Anyways i just add it to the commit. Thank you!

@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-hr_attendance_rest_time_include branch 2 times, most recently from bbc523f to faec668 Compare January 5, 2026 12:20
<group name="breaks">
<group>
<field
name="rest_time_ids"
Copy link
Member

Choose a reason for hiding this comment

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

Why adding this if it's invisible?

@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-hr_attendance_rest_time_include branch from faec668 to a7bb04c Compare January 5, 2026 12:29
@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-hr_attendance_rest_time_include branch from a7bb04c to aa0d717 Compare January 5, 2026 12:36
@eduezerouali-tecnativa eduezerouali-tecnativa force-pushed the 15.0-add-hr_attendance_rest_time_include branch from aa0d717 to d729f42 Compare January 5, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants