Skip to content

[18.0][MIG] hr_employee_document: Migration to 18.0 #1418

Open
BhaveshHeliconia wants to merge 24 commits intoOCA:18.0from
HeliconiaIO:18.0-mig-hr_employee_document
Open

[18.0][MIG] hr_employee_document: Migration to 18.0 #1418
BhaveshHeliconia wants to merge 24 commits intoOCA:18.0from
HeliconiaIO:18.0-mig-hr_employee_document

Conversation

@BhaveshHeliconia
Copy link
Contributor

No description provided.

@BhaveshHeliconia BhaveshHeliconia mentioned this pull request Dec 19, 2024
23 tasks
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-hr_employee_document branch from b9c639d to df67f21 Compare February 25, 2025 05:18
Copy link

@ChristianSantamaria ChristianSantamaria left a comment

Choose a reason for hiding this comment

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

Be careful, you must first perform the pre-commit by making the first commit with the name: "[IMP] hr_employee_document: pre-commit auto fixes" and then add the changes and proceed to commit: "[MIG] hr_employee_document: Migration to 17.0"

More info: https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-18.0

@BhaveshHeliconia
Copy link
Contributor Author

@ChristianSantamaria, I followed the instructed steps. However, when running the format/patch command for the pre-commit, there were no changes detected. As a result, the commit [IMP] hr_employee_document: pre-commit auto fixes is not included in this PR since there were no auto-fixes needed.

Copy link

@peluko00 peluko00 left a comment

Choose a reason for hiding this comment

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

LGTM! Code review and tested in runboat

@ChristianSantamaria
Copy link

@BhaveshHeliconia Okey, could you check the tests since there are lines not covered?

Copy link

@andreampiovesana andreampiovesana left a comment

Choose a reason for hiding this comment

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

LGTM

@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-hr_employee_document branch from df67f21 to 25f30f8 Compare July 4, 2025 10:08
@BhaveshHeliconia
Copy link
Contributor Author

@ChristianSantamaria : Please review. Thanks

@BhaveshHeliconia
Copy link
Contributor Author

Ping @ChristianSantamaria

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@andreampiovesana
Copy link

merge?

@BhaveshHeliconia
Copy link
Contributor Author

Hey @OCA/human-resources-maintainers Could you merge this?

@dreispt
Copy link
Member

dreispt commented Jan 6, 2026

/ocabot migration hr_employee_document
/ocabot merge nobump

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Jan 6, 2026
@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 18.0-ocabot-merge-pr-1418-by-dreispt-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Jan 6, 2026
Signed-off-by dreispt
@peluko00
Copy link

peluko00 commented Jan 7, 2026

Maybe is not working @dreispt, can you retry the command please?

Copy link
Member

@marcelsavegnago marcelsavegnago left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@alexey-pelykh alexey-pelykh left a comment

Choose a reason for hiding this comment

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

Thanks for the migration, looks good overall. The check_access_rights -> check_access adaptation for 18.0 is correct.

One thing worth noting: read_group() is deprecated since Odoo 17 in favor of _read_group() (see odoo/odoo#110737). In hr_employee.py _compute_document_count, the call to self.env["ir.attachment"].read_group(...) could be updated to use _read_group with the new signature. Not blocking given the module works and CI is green, but it would be good to address in a follow-up or before merge if easy enough.

Also minor: the .pot file still references Project-Id-Version: Odoo Server 17.0 -- should be regenerated for 18.0 (usually handled by oca-gen-addon-readme / oca-gen-pot).

self.document_count = 0
attachment_groups = self.env["ir.attachment"].read_group(
[("res_model", "=", "hr.employee"), ("res_id", "in", self.ids)],
["res_id"],
Copy link
Contributor

Choose a reason for hiding this comment

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

read_group() is deprecated since 17.0. Consider migrating to _read_group():

results = self.env['ir.attachment']._read_group(
    [('res_model', '=', 'hr.employee'), ('res_id', 'in', self.ids)],
    groupby=['res_id'],
    aggregates=['__count'],
)
count_dict = {res_id.id: count for res_id, count in results}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review and for pointing this out.
I've updated the read_group() call to use _read_group() and regenerated the .pot file for 18.0.

badbole and others added 21 commits March 5, 2026 11:48
Replacing google drive link in view by nothing, that is deleting,
breaks the view inheritance.
Making it invisible instead.

hr_employee_document 12.0.1.0.1
[UPD] Update hr_employee_document.pot
[UPD] Update hr_employee_document.pot

[UPD] README.rst

hr_employee_document 13.0.2.0.0

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: hr-13.0/hr-13.0-hr_employee_document
Translate-URL: https://translation.odoo-community.org/projects/hr-13-0/hr-13-0-hr_employee_document/
…mployee groups can access to attachments related to own employee

[UPD] README.rst

hr_employee_document 13.0.3.0.0
TT37024

[UPD] Update hr_employee_document.pot

[UPD] README.rst
…void side effects.

The purpose of this module is to allow a basic user (without hr permissions) to view
the attachments related to his employee (hr.employee).

By default a basic user cannot access to hr.employee model and therefore
cannot see the attachments (ir.attachment) linked to it.

This change overrides some things to allow the user's employee attachments to be displayed.

TT44536
Currently translated at 100.0% (7 of 7 strings)

Translation: hr-16.0/hr-16.0-hr_employee_document
Translate-URL: https://translation.odoo-community.org/projects/hr-16-0/hr-16-0-hr_employee_document/it/
Currently translated at 100.0% (7 of 7 strings)

Translation: hr-16.0/hr-16.0-hr_employee_document
Translate-URL: https://translation.odoo-community.org/projects/hr-16-0/hr-16-0-hr_employee_document/es/
Currently translated at 100.0% (7 of 7 strings)

Translation: hr-16.0/hr-16.0-hr_employee_document
Translate-URL: https://translation.odoo-community.org/projects/hr-16-0/hr-16-0-hr_employee_document/fr/
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-hr_employee_document branch from 25f30f8 to 8171976 Compare March 5, 2026 06:37
@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-hr_employee_document branch from 8171976 to d059da3 Compare March 5, 2026 06:49
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.