From 1a7d0e38784a76353bc2a64b331439d5e6ccbf5d Mon Sep 17 00:00:00 2001 From: Ruchir Shukla Date: Tue, 1 Oct 2024 19:02:18 +0530 Subject: [PATCH] [MIG][15.0]hr_timesheet_sheet_policy_department_manager:Migration to 15.0 --- .../README.rst | 12 ++++++------ .../__manifest__.py | 2 +- .../models/hr_timesheet_sheet.py | 7 ++----- .../static/description/index.html | 19 +++++++++++-------- ...mesheet_sheet_policy_department_manager.py | 10 ++-------- 5 files changed, 22 insertions(+), 28 deletions(-) diff --git a/hr_timesheet_sheet_policy_department_manager/README.rst b/hr_timesheet_sheet_policy_department_manager/README.rst index d81c6da432..eacc6f4fb8 100644 --- a/hr_timesheet_sheet_policy_department_manager/README.rst +++ b/hr_timesheet_sheet_policy_department_manager/README.rst @@ -7,7 +7,7 @@ HR Timesheet Sheet: Department Manager Policy !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:408d0f3f32baba01f40ac476804acffc2a520e66c84968795788949768037528 + !! source digest: sha256:53a3750b8c095496ecede45f612df212f21d19499ca0260b12471f46bee98b45 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -17,13 +17,13 @@ HR Timesheet Sheet: Department Manager Policy :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ftimesheet-lightgray.png?logo=github - :target: https://github.com/OCA/timesheet/tree/14.0/hr_timesheet_sheet_policy_department_manager + :target: https://github.com/OCA/timesheet/tree/15.0/hr_timesheet_sheet_policy_department_manager :alt: OCA/timesheet .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/timesheet-14-0/timesheet-14-0-hr_timesheet_sheet_policy_department_manager + :target: https://translation.odoo-community.org/projects/timesheet-15-0/timesheet-15-0-hr_timesheet_sheet_policy_department_manager :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/timesheet&target_branch=14.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/timesheet&target_branch=15.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -41,7 +41,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -76,6 +76,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/timesheet `_ project on GitHub. +This module is part of the `OCA/timesheet `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_timesheet_sheet_policy_department_manager/__manifest__.py b/hr_timesheet_sheet_policy_department_manager/__manifest__.py index cbc382bd1d..abae5448f9 100644 --- a/hr_timesheet_sheet_policy_department_manager/__manifest__.py +++ b/hr_timesheet_sheet_policy_department_manager/__manifest__.py @@ -4,7 +4,7 @@ { "name": "HR Timesheet Sheet: Department Manager Policy", - "version": "14.0.1.0.0", + "version": "15.0.1.0.0", "author": "CorporateHub, Odoo Community Association (OCA)", "website": "https://github.com/OCA/timesheet", "license": "AGPL-3", diff --git a/hr_timesheet_sheet_policy_department_manager/models/hr_timesheet_sheet.py b/hr_timesheet_sheet_policy_department_manager/models/hr_timesheet_sheet.py index 6d20aa10b7..cdd7aa3bb0 100644 --- a/hr_timesheet_sheet_policy_department_manager/models/hr_timesheet_sheet.py +++ b/hr_timesheet_sheet_policy_department_manager/models/hr_timesheet_sheet.py @@ -41,10 +41,6 @@ def fields_view_get( ).replace("\t", "") return res - @api.depends("department_id.manager_id.user_id") - def _compute_department_manager_as_reviewer(self): - self._compute_possible_reviewer_ids() - def _get_complete_name_components(self): self.ensure_one() result = super()._get_complete_name_components() @@ -60,9 +56,10 @@ def _get_possible_reviewers(self): return res def _check_can_review(self): - super()._check_can_review() + res = super()._check_can_review() if self.filtered( lambda sheet: not sheet.can_review and sheet.review_policy == "department_manager" ): raise UserError(_("Only a Department's Manager can review the sheet.")) + return res diff --git a/hr_timesheet_sheet_policy_department_manager/static/description/index.html b/hr_timesheet_sheet_policy_department_manager/static/description/index.html index 70101e4eda..a66251f48c 100644 --- a/hr_timesheet_sheet_policy_department_manager/static/description/index.html +++ b/hr_timesheet_sheet_policy_department_manager/static/description/index.html @@ -9,10 +9,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +276,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +302,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -367,9 +368,9 @@

HR Timesheet Sheet: Department Manager Policy

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:408d0f3f32baba01f40ac476804acffc2a520e66c84968795788949768037528 +!! source digest: sha256:53a3750b8c095496ecede45f612df212f21d19499ca0260b12471f46bee98b45 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/timesheet Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/timesheet Translate me on Weblate Try me on Runboat

This module allows setting Department Manager as Reviewer on Timesheet Sheets.

Table of contents

@@ -388,7 +389,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -415,11 +416,13 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/timesheet project on GitHub.

+

This module is part of the OCA/timesheet project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/hr_timesheet_sheet_policy_department_manager/tests/test_hr_timesheet_sheet_policy_department_manager.py b/hr_timesheet_sheet_policy_department_manager/tests/test_hr_timesheet_sheet_policy_department_manager.py index c15d26ae2b..bd5328a931 100644 --- a/hr_timesheet_sheet_policy_department_manager/tests/test_hr_timesheet_sheet_policy_department_manager.py +++ b/hr_timesheet_sheet_policy_department_manager/tests/test_hr_timesheet_sheet_policy_department_manager.py @@ -29,9 +29,7 @@ def setUp(self): ) self.env.user.company_ids += self.company self.department_manager_user = self.ResUsers.with_context( - { - "no_reset_password": True, - } + no_reset_password=True ).create( { "name": "Department Manager User", @@ -52,11 +50,7 @@ def setUp(self): "company_ids": [(4, self.company.id)], } ) - self.employee_user = self.ResUsers.with_context( - { - "no_reset_password": True, - } - ).create( + self.employee_user = self.ResUsers.with_context(no_reset_password=True).create( { "name": "Employee User", "login": "employee_user",