From 14664ac788f7f0059cf1691fe8bb91d2f6526b83 Mon Sep 17 00:00:00 2001 From: Bhavesh Heliconia Date: Thu, 2 Jan 2025 18:30:37 +0530 Subject: [PATCH] [MIG] hr_timesheet_task_required: Migration to 18.0 --- hr_timesheet_task_required/README.rst | 27 ++++++++++--------- hr_timesheet_task_required/__manifest__.py | 2 +- .../models/account_analytic_line.py | 10 +++---- .../readme/CONTRIBUTORS.md | 1 + .../static/description/index.html | 18 ++++++++----- .../tests/test_hr_timesheet_task_required.py | 11 ++++++-- .../views/account_analytic_line.xml | 6 ----- .../views/project_project.xml | 7 ++--- 8 files changed, 45 insertions(+), 37 deletions(-) diff --git a/hr_timesheet_task_required/README.rst b/hr_timesheet_task_required/README.rst index f1c09b154..525dbd180 100644 --- a/hr_timesheet_task_required/README.rst +++ b/hr_timesheet_task_required/README.rst @@ -17,13 +17,13 @@ Hr Timesheet Task Required :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/17.0/hr_timesheet_task_required + :target: https://github.com/OCA/timesheet/tree/18.0/hr_timesheet_task_required :alt: OCA/timesheet .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/timesheet-17-0/timesheet-17-0-hr_timesheet_task_required + :target: https://translation.odoo-community.org/projects/timesheet-18-0/timesheet-18-0-hr_timesheet_task_required :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=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/timesheet&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -56,7 +56,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. @@ -72,16 +72,17 @@ Authors Contributors ------------ -- Adrien Peiffer -- Laurent Mignon -- Benjamin Willig -- `CorporateHub `__ +- Adrien Peiffer +- Laurent Mignon +- Benjamin Willig +- `CorporateHub `__ - - Alexey Pelykh + - Alexey Pelykh -- Saran Lim. -- Foram Shah -- Houssine Bakkali +- Saran Lim. +- Foram Shah +- Houssine Bakkali +- ``Heliconia Solutions Pvt. Ltd. ``\ \_ Maintainers ----------- @@ -96,6 +97,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_task_required/__manifest__.py b/hr_timesheet_task_required/__manifest__.py index 41f2e4044..fd620c450 100644 --- a/hr_timesheet_task_required/__manifest__.py +++ b/hr_timesheet_task_required/__manifest__.py @@ -7,7 +7,7 @@ "name": "Hr Timesheet Task Required", "summary": """ Set task on timesheet as a mandatory field""", - "version": "17.0.1.0.1", + "version": "18.0.1.0.0", "license": "AGPL-3", "author": "ACSONE SA/NV, CorporateHub, Odoo Community Association (OCA)", "website": "https://github.com/OCA/timesheet", diff --git a/hr_timesheet_task_required/models/account_analytic_line.py b/hr_timesheet_task_required/models/account_analytic_line.py index 831ae15a2..f93ece12d 100644 --- a/hr_timesheet_task_required/models/account_analytic_line.py +++ b/hr_timesheet_task_required/models/account_analytic_line.py @@ -2,19 +2,19 @@ # Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models +from odoo import api, fields, models from odoo.exceptions import ValidationError class AccountAnalyticLine(models.Model): _inherit = "account.analytic.line" - is_task_required = fields.Boolean( - string="Is Task Required", related="project_id.is_timesheet_task_required" - ) + is_task_required = fields.Boolean(related="project_id.is_timesheet_task_required") @api.constrains("project_id", "task_id") def _check_timesheet_task(self): for line in self: if line.is_task_required and not line.task_id: - raise ValidationError(_("You must specify a task for timesheet lines.")) + raise ValidationError( + self.env._("You must specify a task for timesheet lines.") + ) diff --git a/hr_timesheet_task_required/readme/CONTRIBUTORS.md b/hr_timesheet_task_required/readme/CONTRIBUTORS.md index 351c0ccb4..360e6cd17 100644 --- a/hr_timesheet_task_required/readme/CONTRIBUTORS.md +++ b/hr_timesheet_task_required/readme/CONTRIBUTORS.md @@ -6,3 +6,4 @@ - Saran Lim. \<\> - Foram Shah \<\> - Houssine Bakkali \<\> +- `Heliconia Solutions Pvt. Ltd. `_ diff --git a/hr_timesheet_task_required/static/description/index.html b/hr_timesheet_task_required/static/description/index.html index 171b4c579..b9b7238fe 100644 --- a/hr_timesheet_task_required/static/description/index.html +++ b/hr_timesheet_task_required/static/description/index.html @@ -8,10 +8,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. @@ -274,7 +275,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 } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -368,7 +369,7 @@

Hr Timesheet Task Required

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:f8501c73ef6470fdc79a7a9a6b2e05c513be62054670b2e2840f061a009c2fdb !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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 to configure project as having task on timesheet as a mandatory field.

Table of contents

@@ -399,7 +400,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.

@@ -424,16 +425,19 @@

Contributors

  • Saran Lim. <saranl@ecosoft.co.th>
  • Foram Shah <foram.shah@initos.com>
  • Houssine Bakkali <houssine.bakkali@eezee-it.com>
  • +
  • Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>_
  • 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_task_required/tests/test_hr_timesheet_task_required.py b/hr_timesheet_task_required/tests/test_hr_timesheet_task_required.py index 16388bd95..d6c5641c1 100644 --- a/hr_timesheet_task_required/tests/test_hr_timesheet_task_required.py +++ b/hr_timesheet_task_required/tests/test_hr_timesheet_task_required.py @@ -50,7 +50,11 @@ def test_timesheet_line_task_required(self): ) def test_timesheet_line_task_not_required(self): - self.AnalyticLine.create( + # Project with task not required + self.assertFalse(self.project_2.is_timesheet_task_required) + + # Create a timesheet line without a task + timesheet_line = self.AnalyticLine.create( { "name": "test", "project_id": self.project_2.id, @@ -58,8 +62,10 @@ def test_timesheet_line_task_not_required(self): "employee_id": self.employee.id, } ) + self.assertTrue(timesheet_line) - self.AnalyticLine.create( + # Create a timesheet line with a task + timesheet_line_with_task = self.AnalyticLine.create( { "name": "test", "project_id": self.project_2.id, @@ -68,3 +74,4 @@ def test_timesheet_line_task_not_required(self): "employee_id": self.employee.id, } ) + self.assertTrue(timesheet_line_with_task) diff --git a/hr_timesheet_task_required/views/account_analytic_line.xml b/hr_timesheet_task_required/views/account_analytic_line.xml index a71d8c667..5107b7a69 100644 --- a/hr_timesheet_task_required/views/account_analytic_line.xml +++ b/hr_timesheet_task_required/views/account_analytic_line.xml @@ -10,9 +10,6 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). account.analytic.line - - - is_task_required @@ -23,9 +20,6 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). account.analytic.line - - - is_task_required diff --git a/hr_timesheet_task_required/views/project_project.xml b/hr_timesheet_task_required/views/project_project.xml index f8011509e..8fe39f81b 100644 --- a/hr_timesheet_task_required/views/project_project.xml +++ b/hr_timesheet_task_required/views/project_project.xml @@ -15,7 +15,7 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). @@ -25,11 +25,12 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). project.project - + +