[IMP] hr_attendance: move group inside the view

The goal being to get rid of the `groups_id` feature for backend views

Changing the invisible attributes for the presence icon
is a bit weird:
- when a user logged in, you could see the green ball next to his name,
- but when he checks in in the attendance app, the green ball disapear,
  hidding his presence status.

Maybe in the past, there was a smart button
also showing the presence status,
therefore the information was twice in the form
view, and this is maybe why this change of attributes
was put in place,
but this is no longer the case,
there is no other way to see an employee has signed in or checked in
from the form view once he checked in in the attendance app,
which is weird.
It therefore has been decided to remove this change of attribute
in this inherited view.

Part-of: odoo/odoo#98551
This commit is contained in:
Denis Ledoux
2022-08-29 22:42:56 +02:00
parent b84dbc975a
commit fdcaeb479a
@@ -5,13 +5,7 @@
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="priority">110</field>
<field name="groups_id" eval="[(4,ref('hr_attendance.group_hr_attendance_user'))]"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='hr_presence_status']" position="attributes">
<attribute name="attrs">
{'invisible': ['|', '|', ('user_id', '=', False), ('hr_presence_state', '=', 'absent'), ('attendance_state', '=', 'checked_in')]}
</attribute>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<field name="attendance_state" invisible="1"/>
<button name="%(hr_attendance_action)d"
@@ -19,7 +13,7 @@
icon="fa-clock-o"
type="action"
context="{'search_default_employee_id': id, 'search_default_check_in_filter': '1'}"
groups="base.group_user"
groups="hr_attendance.group_hr_attendance_user"
help="Worked hours last month">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
@@ -35,7 +29,8 @@
icon="fa-history"
type="action"
attrs="{'invisible': [('total_overtime', '=', 0.0)]}"
context="{'search_default_employee_id': active_id}">
context="{'search_default_employee_id': active_id}"
groups="hr_attendance.group_hr_attendance_user">
<div class="o_stat_info">
<span class="o_stat_value text-success" attrs="{'invisible': [('total_overtime', '&lt;', 0)]}">
<field name="total_overtime" widget="float_time"/>