[FIX] portal_holidays: restrict overtime hint to internal users in view - #440
[FIX] portal_holidays: restrict overtime hint to internal users in view#440nicomacr wants to merge 1 commit into
Conversation
- Add view inheriting hr_holidays.hr_leave_allocation_view_form setting groups="base.group_user" on the div showing employee_overtime (element added by hr_holidays_attendance) - Granting the field to group_portal_backend_holiday in Python is not enough: during -u all the hr_holidays_attendance views are validated before this module's override is loaded in the registry, so every full upgrade logged 4 "Access Rights Inconsistency" warnings. View-level groups live in the DB and hold during that window. Change note: Los usuarios del portal con acceso a Ausencias dejan de ver el indicador "Extra Hours Available" (horas extra disponibles) en sus asignaciones; ese dato queda visible solo para usuarios internos. Con esto, las actualizaciones de versión dejan de registrar advertencias sobre esa pantalla.
|
Closing: verified on a 19.0 database that this change does not remove the warning. The 4 Reproduced: install 0 / |

Problem
Every full upgrade (
-u all) of a database withportal_holidaysinstalled logs 4Access Rights Inconsistencywarnings on thehr.leave.allocationviews:hr_holidays_attendanceadds a div showingemployee_overtime(restricted tobase.group_user) to the allocation form.group_portal_backend_holidayin Python (fieldgroupsoverride).-u all, the views ofhr_holidays_attendance(module ~284 of ~750) are validated beforeportal_holidays(~381) is loaded into the registry. At that point the validator sees the element shown to the portal group (itsir.model.accessrows are already in the DB) while the field is still only accessible tobase.group_user— a Python group grant from a later module can never win that window.This is why the earlier Python-side fix (ea602fd) silenced CI installs but not full upgrades: 18→19 migration runs reproduce the 4 warnings on every pass (verified on two consecutive upgrade builds).
Fix
Restrict the overtime hint element to
base.group_userat the view level: view inheritance lives in the DB, so it holds during the whole upgrade, including the window before this module's Python is loaded. Portal backend holiday users no longer see the "Extra Hours Available" hint in their allocations; internal users are unaffected.Test plan
-u all(double pass) over a migrated database withportal_holidaysinstalled: noAccess Rights Inconsistencywarnings referencingemployee_overtime(previously 4).Internal task: https://www.adhoc.inc/odoo/project.task/69634