Skip to content

Commit

Permalink
[MIG][15.0]hr_timesheet_sheet_policy_department_manager:Migration to …
Browse files Browse the repository at this point in the history
…15.0
  • Loading branch information
bizzappdev committed Oct 1, 2024
1 parent 9ad3e9c commit 1a7d0e3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 28 deletions.
12 changes: 6 additions & 6 deletions hr_timesheet_sheet_policy_department_manager/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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|
Expand All @@ -41,7 +41,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/timesheet/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 <https://github.com/OCA/timesheet/issues/new?body=module:%20hr_timesheet_sheet_policy_department_manager%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/timesheet/issues/new?body=module:%20hr_timesheet_sheet_policy_department_manager%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand Down Expand Up @@ -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 <https://github.com/OCA/timesheet/tree/14.0/hr_timesheet_sheet_policy_department_manager>`_ project on GitHub.
This module is part of the `OCA/timesheet <https://github.com/OCA/timesheet/tree/15.0/hr_timesheet_sheet_policy_department_manager>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@

/*
:Author: David Goodger ([email protected])
: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.
Expand Down Expand Up @@ -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 }
Expand All @@ -301,7 +302,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -367,9 +368,9 @@ <h1 class="title">HR Timesheet Sheet: Department Manager Policy</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:408d0f3f32baba01f40ac476804acffc2a520e66c84968795788949768037528
!! source digest: sha256:53a3750b8c095496ecede45f612df212f21d19499ca0260b12471f46bee98b45
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/timesheet/tree/14.0/hr_timesheet_sheet_policy_department_manager"><img alt="OCA/timesheet" src="https://img.shields.io/badge/github-OCA%2Ftimesheet-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/timesheet-14-0/timesheet-14-0-hr_timesheet_sheet_policy_department_manager"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/timesheet&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/timesheet/tree/15.0/hr_timesheet_sheet_policy_department_manager"><img alt="OCA/timesheet" src="https://img.shields.io/badge/github-OCA%2Ftimesheet-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/timesheet-15-0/timesheet-15-0-hr_timesheet_sheet_policy_department_manager"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/timesheet&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows setting Department Manager as Reviewer on Timesheet Sheets.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand All @@ -388,7 +389,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/timesheet/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/timesheet/issues/new?body=module:%20hr_timesheet_sheet_policy_department_manager%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/timesheet/issues/new?body=module:%20hr_timesheet_sheet_policy_department_manager%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -415,11 +416,13 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/timesheet/tree/14.0/hr_timesheet_sheet_policy_department_manager">OCA/timesheet</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/timesheet/tree/15.0/hr_timesheet_sheet_policy_department_manager">OCA/timesheet</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 1a7d0e3

Please sign in to comment.