Skip to content

Commit

Permalink
[ADD] project_task_type: add new module
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthwhy committed Jun 13, 2024
1 parent 33c00e8 commit 304e81d
Show file tree
Hide file tree
Showing 13 changed files with 606 additions and 0 deletions.
66 changes: 66 additions & 0 deletions project_task_type/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
=================
Project Task Type
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:75b26fafcf6a5825580319e508b9d3dc156ee1f6808e96bc31b6f848d2c6e79d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-Escodoo%2Fescodoo--addons-lightgray.png?logo=github
:target: https://github.com/Escodoo/escodoo-addons/tree/14.0/project_task_type
:alt: Escodoo/escodoo-addons

|badge1| |badge2| |badge3|

The module aims to create a new field called task stage

**Table of contents**

.. contents::
:local:

Usage
=====

It will create a field in the time entry and in the analytical line

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/Escodoo/escodoo-addons/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/Escodoo/escodoo-addons/issues/new?body=module:%20project_task_type%0Aversion:%2014.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.

Credits
=======

Authors
~~~~~~~

* Escodoo

Contributors
~~~~~~~~~~~~

Matheus Marques <[email protected]>
Marcel Savegnago <[email protected]>

Maintainers
~~~~~~~~~~~

This module is part of the `Escodoo/escodoo-addons <https://github.com/Escodoo/escodoo-addons/tree/14.0/project_task_type>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions project_task_type/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions project_task_type/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright TODAY, 2024 Escodoo
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Project Task Type",
"summary": """
Create task stages linked to time recording""",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "Escodoo",
"website": "https://github.com/Escodoo/escodoo-addons",
"depends": ["project", "hr_timesheet_sheet"],
"data": ["views/project_task_type.xml"],
}
1 change: 1 addition & 0 deletions project_task_type/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import project_task_type
49 changes: 49 additions & 0 deletions project_task_type/models/project_task_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright TODAY, 2024 Matheus Marques <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class ProjectTaskType(models.Model):
_name = "project.task.type"
_description = "Project Task Type"
_order = "sequence, id"

name = fields.Char(string="Name", required=True)
create_date = fields.Datetime(string="Created on", readonly=True)
create_uid = fields.Many2one("res.users", string="Created by", readonly=True)
write_date = fields.Datetime(string="Last Updated on", readonly=True)
write_uid = fields.Many2one("res.users", string="Last Updated by", readonly=True)
active = fields.Boolean(string="Active", default=True)
sequence = fields.Integer(string="Sequence")
description = fields.Text(string="Description")
display_name = fields.Char(string="Display Name", readonly=True)
mail_template_id = fields.Many2one("mail.template", string="Mail Template")
project_ids = fields.Many2many("project.project", string="Projects")
rating_template_id = fields.Many2one("mail.template", string="Rating Mail Template")
is_closed = fields.Boolean(string="Is Closed")
is_cancelled = fields.Boolean(string="Is Cancelled")
legend_blocked = fields.Char(string="Legend Blocked")
legend_done = fields.Char(string="Legend Done")
legend_normal = fields.Char(string="Legend Normal")
fold = fields.Boolean(string="Folded in Kanban")


class HrTimesheetSheetLine(models.TransientModel):
_inherit = "hr_timesheet.sheet.line"

project_task_type = fields.Many2one("project.task.type", string="Task stage")


class AccountAnalyticLine(models.Model):
_inherit = "account.analytic.line"

project_task_type = fields.Many2one("project.task.type", string="Task stage")

@api.model
def create(self, vals):
if "task_id" in vals:
task = self.env["project.task"].browse(vals["task_id"])
if task:
vals["project_task_type"] = task.stage_id.id
return super(AccountAnalyticLine, self).create(vals)
2 changes: 2 additions & 0 deletions project_task_type/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Matheus Marques <[email protected]>
Marcel Savegnago <[email protected]>
1 change: 1 addition & 0 deletions project_task_type/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The module aims to create a new field called task stage
1 change: 1 addition & 0 deletions project_task_type/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
It will create a field in the time entry and in the analytical line
Binary file added project_task_type/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 304e81d

Please sign in to comment.