[18.0][MIG] hr_employee_document: Migration to 18.0 #1418
[18.0][MIG] hr_employee_document: Migration to 18.0 #1418BhaveshHeliconia wants to merge 24 commits intoOCA:18.0from
Conversation
b9c639d to
df67f21
Compare
ChristianSantamaria
left a comment
There was a problem hiding this comment.
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
|
@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. |
peluko00
left a comment
There was a problem hiding this comment.
LGTM! Code review and tested in runboat
|
@BhaveshHeliconia Okey, could you check the tests since there are lines not covered? |
df67f21 to
25f30f8
Compare
|
@ChristianSantamaria : Please review. Thanks |
|
Ping @ChristianSantamaria |
|
This PR has the |
|
merge? |
|
Hey @OCA/human-resources-maintainers Could you merge this? |
|
/ocabot migration hr_employee_document |
|
This PR looks fantastic, let's merge it! |
|
Maybe is not working @dreispt, can you retry the command please? |
alexey-pelykh
left a comment
There was a problem hiding this comment.
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"], |
There was a problem hiding this comment.
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}There was a problem hiding this comment.
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.
…mployee profile [UPD] Update hr_employee_document.pot [ADD] icon.png
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
hr_employee_document 12.0.1.1.0
[UPD] Update hr_employee_document.pot
[UPD] README.rst
[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/
…ployees for one user TT49830
25f30f8 to
8171976
Compare
8171976 to
d059da3
Compare
No description provided.