Skip to content

[18.0][FIX] hr_appraisal_oca: read public employee profiles - #1670

Open
parabol123654 wants to merge 1 commit into
OCA:18.0from
parabol123654:18.0-fix-hr_appraisal_oca-public-employee
Open

parabol123654 wants to merge 1 commit into
OCA:18.0from
parabol123654:18.0-fix-hr_appraisal_oca-public-employee

Conversation

@parabol123654

@parabol123654 parabol123654 commented Nov 12, 2026 •

Copy link
Copy Markdown

Fixes #1669.

can_open_last_appraisal is defined on hr.employee.base, so it is also computed for hr.employee.public. Its compute reads employee.sudo().allowed_user_ids, which only exists on hr.employee. Reading the public profiles with all their fields therefore raises:

AttributeError: 'hr.employee.public' object has no attribute 'allowed_user_ids'

The fix reads the allowed users on the hr.employee record of the same id (public profiles share the ids of the employees), as superuser, like the compute already did since #1662.

Test: test_read_public_employees reads the public profiles with all fields as an internal user.

  • Without the fix: the AttributeError above.
  • With the fix: the profiles are read. The module tests pass (10).

Assisted-by: Claude Opus 5.5

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @ebauza, @pedrobaeza,
some modules you are maintaining are being modified, check this out!

@parabol123654
parabol123654 force-pushed the 18.0-fix-hr_appraisal_oca-public-employee branch from 8c2e6e1 to 58fc466 Compare November 12, 2026 17:41
can_open_last_appraisal is defined on hr.employee.base, so it is also
computed for hr.employee.public, but its compute read allowed_user_ids,
which only exists on hr.employee: reading the public profiles with all
their fields raised an AttributeError. Read the allowed users on the
hr.employee record of the same id.

Fixes OCA#1669

Assisted-by: Claude Opus 5.5
@parabol123654
parabol123654 force-pushed the 18.0-fix-hr_appraisal_oca-public-employee branch from 58fc466 to 67565b0 Compare November 14, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants