diff --git a/project_task_additional_attributes/README.rst b/project_task_additional_attributes/README.rst new file mode 100644 index 00000000..ea747589 --- /dev/null +++ b/project_task_additional_attributes/README.rst @@ -0,0 +1,55 @@ +================================== +Project Task Additional Attributes +================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:bdf037f64561b486b6f5247fba0f6199da45951ebc9862dd252384c651bf0d66 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-qrtl%2Faxls--custom-lightgray.png?logo=github + :target: https://github.com/qrtl/axls-custom/tree/16.0/project_task_additional_attributes + :alt: qrtl/axls-custom + +|badge1| |badge2| |badge3| + +This module adds new fields to the project.task model. + +**Table of contents** + +.. contents:: + :local: + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Quartile Limited + +Maintainers +----------- + +This module is part of the `qrtl/axls-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/project_task_additional_attributes/__init__.py b/project_task_additional_attributes/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/project_task_additional_attributes/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/project_task_additional_attributes/__manifest__.py b/project_task_additional_attributes/__manifest__.py new file mode 100644 index 00000000..36e70560 --- /dev/null +++ b/project_task_additional_attributes/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2023 Quartile Limited +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). +{ + "name": "Project Task Additional Attributes", + "version": "16.0.1.0.0", + "category": "project", + "website": "https://www.quartile.co", + "author": "Quartile Limited", + "license": "LGPL-3", + "depends": ["project"], + "data": [ + "views/project_task_views.xml", + ], +} diff --git a/project_task_additional_attributes/models/__init__.py b/project_task_additional_attributes/models/__init__.py new file mode 100644 index 00000000..edf2d36b --- /dev/null +++ b/project_task_additional_attributes/models/__init__.py @@ -0,0 +1 @@ +from . import project_task diff --git a/project_task_additional_attributes/models/project_task.py b/project_task_additional_attributes/models/project_task.py new file mode 100644 index 00000000..1069b2f8 --- /dev/null +++ b/project_task_additional_attributes/models/project_task.py @@ -0,0 +1,29 @@ +# Copyright 2023 Quartile Limited +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + + +class ProjectTask(models.Model): + _inherit = "project.task" + + view_id_list = fields.Char( + string="View ID", help="List of numeric values separated by commas." + ) + is_feasible = fields.Selection([("yes", "Yes"), ("no", "No")], string="Feasible?") + + @api.constrains("view_id_list") + def _check_view_id_list(self): + for record in self: + if record.view_id_list: + try: + # Attempt to convert each value to an integer, allowing spaces + [ + int(val.strip()) + for val in record.view_id_list.replace(" ", "").split(",") + ] + except ValueError as err: + raise ValidationError( + _("Please enter only numeric values in the View ID field.") + ) from err diff --git a/project_task_additional_attributes/readme/DESCRIPTION.md b/project_task_additional_attributes/readme/DESCRIPTION.md new file mode 100644 index 00000000..858199c5 --- /dev/null +++ b/project_task_additional_attributes/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module adds new fields to the project.task model. diff --git a/project_task_additional_attributes/static/description/index.html b/project_task_additional_attributes/static/description/index.html new file mode 100644 index 00000000..8ccc625f --- /dev/null +++ b/project_task_additional_attributes/static/description/index.html @@ -0,0 +1,409 @@ + + + + + + +Project Task Additional Attributes + + + +
+

Project Task Additional Attributes

+ + +

Beta License: LGPL-3 qrtl/axls-custom

+

This module adds new fields to the project.task model.

+

Table of contents

+ +
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Quartile Limited
  • +
+
+
+

Maintainers

+

This module is part of the qrtl/axls-custom project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/project_task_additional_attributes/views/project_task_views.xml b/project_task_additional_attributes/views/project_task_views.xml new file mode 100644 index 00000000..ed55cb19 --- /dev/null +++ b/project_task_additional_attributes/views/project_task_views.xml @@ -0,0 +1,14 @@ + + + + project.task.form + project.task + + + + + + + + + diff --git a/setup/project_task_additional_attributes/odoo/addons/project_task_additional_attributes b/setup/project_task_additional_attributes/odoo/addons/project_task_additional_attributes new file mode 120000 index 00000000..1fc5adbd --- /dev/null +++ b/setup/project_task_additional_attributes/odoo/addons/project_task_additional_attributes @@ -0,0 +1 @@ +../../../../project_task_additional_attributes \ No newline at end of file diff --git a/setup/project_task_additional_attributes/setup.py b/setup/project_task_additional_attributes/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/project_task_additional_attributes/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)