Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions project_task_name_with_id/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=========================
Project Task Name with ID
=========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5180287a1ce53ba3eb560ab3322d2059df11868e185030459bb0c7357eb64b77
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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-OCA%2Fproject-lightgray.png?logo=github
:target: https://github.com/OCA/project/tree/19.0/project_task_name_with_id
:alt: OCA/project
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/project-19-0/project-19-0-project_task_name_with_id
: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/project&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the name_search() and name_get() methods of the
project.task model to search for, and display the ID of the task in the
name field.

This module will simplify your operations if they heavily rely on the
task ID. For instance, you can select a task by its ID when creating a
timesheet record.

**Table of contents**

.. contents::
:local:

Usage
=====

The task's display name will change to a concatenation of its ID and
task name (e.g., [ID] task_name). You can search for the task using its
ID in the Many2one field or in the search view.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/project/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/project/issues/new?body=module:%20project_task_name_with_id%0Aversion:%2019.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
-------

* Quartile

Contributors
------------

- `Quartile <https://www.quartile.co>`__:

- Yoshi Tashiro

- Miquel Pascual <mpascual@apsl.net>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why putting him beneath ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @AungKoKoLin1997 included my name here as the module was done by me initially, and he just followed the order of contributions. We will fix it if that's an issue.


Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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/project <https://github.com/OCA/project/tree/19.0/project_task_name_with_id>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions project_task_name_with_id/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
13 changes: 13 additions & 0 deletions project_task_name_with_id/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Project Task Name with ID",
"category": "Project",
"version": "19.0.1.0.0",
"author": "Quartile, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/project",
"license": "AGPL-3",
"depends": ["project"],
"data": ["views/project_task_views.xml"],
"installable": True,
}
22 changes: 22 additions & 0 deletions project_task_name_with_id/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_name_with_id
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-04-19 11:41+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: project_task_name_with_id
#: model:ir.model,name:project_task_name_with_id.model_project_task
msgid "Task"
msgstr "Lavoro"
19 changes: 19 additions & 0 deletions project_task_name_with_id/i18n/project_task_name_with_id.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_name_with_id
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: project_task_name_with_id
#: model:ir.model,name:project_task_name_with_id.model_project_task
msgid "Task"
msgstr ""
1 change: 1 addition & 0 deletions project_task_name_with_id/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import project_task
27 changes: 27 additions & 0 deletions project_task_name_with_id/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2023 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, models
from odoo.fields import Domain


class ProjectTask(models.Model):
_inherit = "project.task"

@api.depends("name")
def _compute_display_name(self):
super()._compute_display_name()
for task in self:
if not task.id:
continue
task.display_name = f"[{task.id}] {task.display_name}"
return

@api.model
def name_search(self, name="", args=None, operator="ilike", limit=100):
args = args or []
domain = Domain.AND(
[args, ["|", ("name", operator, name), ("id", operator, name)]]
)
records = self.search(domain, limit=limit)
return [(rec.id, rec.display_name or "") for rec in records]
3 changes: 3 additions & 0 deletions project_task_name_with_id/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions project_task_name_with_id/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [Quartile](https://www.quartile.co):
- Yoshi Tashiro
- Miquel Pascual \<<mpascual@apsl.net>\>
7 changes: 7 additions & 0 deletions project_task_name_with_id/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This module extends the name_search() and name_get() methods of the
project.task model to search for, and display the ID of the task in the
name field.

This module will simplify your operations if they heavily rely on the
task ID. For instance, you can select a task by its ID when creating a
timesheet record.
3 changes: 3 additions & 0 deletions project_task_name_with_id/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The task's display name will change to a concatenation of its ID and
task name (e.g., \[ID\] task_name). You can search for the task using
its ID in the Many2one field or in the search view.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading