-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] project_task_type: add new module
- Loading branch information
Showing
13 changed files
with
606 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import project_task_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Matheus Marques <[email protected]> | ||
Marcel Savegnago <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The module aims to create a new field called task stage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.