-
-
Notifications
You must be signed in to change notification settings - Fork 870
[19.0][MIG] project_task_name_with_id: Migration to 19.0 #1579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AungKoKoLin1997
wants to merge
17
commits into
OCA:19.0
Choose a base branch
from
qrtl:19.0-mig-project_task_name_with_id
base: 19.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2a2ffcc
[ADD] project_task_name_with_id
AungKoKoLin1997 9be544a
[UPD] Update project_task_name_with_id.pot
34ed5cd
[BOT] post-merge updates
OCA-git-bot ab6181a
Added translation using Weblate (Italian)
mymage 6729755
Translated using Weblate (Italian)
mymage 35b63c7
[16.0][IMP] project_task_name_with_id: improve searching
lbarry-apsl 0bfdddb
[BOT] post-merge updates
OCA-git-bot a4bc6aa
[IMP] project_task_name_with_id: pre-commit auto fixes
lbarry-apsl 6336439
[MIG] project_task_name_with_id: Migration to 17.0
lbarry-apsl de83a79
[UPD] Update project_task_name_with_id.pot
44a3e4e
[BOT] post-merge updates
OCA-git-bot 3f531cb
[FIX] project_task_name_with_id: avoid overriding _compute_display_name
AungKoKoLin1997 e7d0910
[BOT] post-merge updates
OCA-git-bot a9a6247
[MIG] project_task_name_with_id: Migration to 18.0
mpascuall 69a0327
[UPD] Update project_task_name_with_id.pot
2ae1261
[BOT] post-merge updates
OCA-git-bot 4444609
[MIG] project_task_name_with_id: Migration to 19.0
AungKoKoLin1997 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,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> | ||
|
|
||
| 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. | ||
This file contains hidden or 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 hidden or 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,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, | ||
| } |
This file contains hidden or 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,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
19
project_task_name_with_id/i18n/project_task_name_with_id.pot
This file contains hidden or 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,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 "" |
This file contains hidden or 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 |
This file contains hidden or 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,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] |
This file contains hidden or 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,3 @@ | ||
| [build-system] | ||
| requires = ["whool"] | ||
| build-backend = "whool.buildapi" |
This file contains hidden or 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,3 @@ | ||
| - [Quartile](https://www.quartile.co): | ||
| - Yoshi Tashiro | ||
| - Miquel Pascual \<<mpascual@apsl.net>\> |
This file contains hidden or 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,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. |
This file contains hidden or 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,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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why putting him beneath ?
There was a problem hiding this comment.
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.