Skip to content

Commit f39cc57

Browse files
adj
1 parent 3fcd43c commit f39cc57

File tree

3 files changed

+33
-23
lines changed

3 files changed

+33
-23
lines changed

project_task_name_with_id/README.rst

+9-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
Project Task Name with ID
33
=========================
44

5-
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
67
!! This file is generated by oca-gen-addon-readme !!
78
!! changes will be overwritten. !!
89
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:30a8c67c55a13b33d14d24e26f196d3f244654a3947fc5111e39891cc0275d02
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
912
1013
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1114
:target: https://odoo-community.org/page/development-status
@@ -19,11 +22,11 @@ Project Task Name with ID
1922
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
2023
:target: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_name_with_id
2124
:alt: Translate me on Weblate
22-
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23-
:target: https://runbot.odoo-community.org/runbot/140/16.0
24-
:alt: Try me on Runbot
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=16.0
27+
:alt: Try me on Runboat
2528

26-
|badge1| |badge2| |badge3| |badge4| |badge5|
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
2730

2831
This module extends the name_search() and name_get() methods of the project.task model
2932
to search for, and display the ID of the task in the name field.
@@ -47,7 +50,7 @@ Bug Tracker
4750

4851
Bugs are tracked on `GitHub Issues <https://github.com/OCA/project/issues>`_.
4952
In case of trouble, please check there if your issue has already been reported.
50-
If you spotted it first, help us smashing it by providing a detailed and welcomed
53+
If you spotted it first, help us to smash it by providing a detailed and welcomed
5154
`feedback <https://github.com/OCA/project/issues/new?body=module:%20project_task_name_with_id%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5255

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

project_task_name_with_id/static/description/index.html

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
33
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6-
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
6+
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
77
<title>Project Task Name with ID</title>
88
<style type="text/css">
99

1010
/*
1111
:Author: David Goodger ([email protected])
12-
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
12+
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
1313
:Copyright: This stylesheet has been placed in the public domain.
1414
1515
Default cascading style sheet for the HTML output of Docutils.
1616
17-
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
17+
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1818
customize this style sheet.
1919
*/
2020

@@ -366,47 +366,49 @@ <h1 class="title">Project Task Name with ID</h1>
366366
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370+
!! source digest: sha256:30a8c67c55a13b33d14d24e26f196d3f244654a3947fc5111e39891cc0275d02
369371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
370-
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/project/tree/16.0/project_task_name_with_id"><img alt="OCA/project" src="https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_name_with_id"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/140/16.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/project/tree/16.0/project_task_name_with_id"><img alt="OCA/project" src="https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_name_with_id"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/project&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
371373
<p>This module extends the name_search() and name_get() methods of the project.task model
372374
to search for, and display the ID of the task in the name field.</p>
373375
<p>This module will simplify your operations if they heavily rely on the task ID. For
374376
instance, you can select a task by its ID when creating a timesheet record.</p>
375377
<p><strong>Table of contents</strong></p>
376378
<div class="contents local topic" id="contents">
377379
<ul class="simple">
378-
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
379-
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
380-
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
381-
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
382-
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
380+
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
381+
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
382+
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
383+
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
384+
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
383385
</ul>
384386
</li>
385387
</ul>
386388
</div>
387389
<div class="section" id="usage">
388-
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
390+
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
389391
<p>The task’s display name will change to a concatenation of its ID and task name (e.g., [ID] task_name).
390392
You can search for the task using its ID in the Many2one field or in the search view.</p>
391393
</div>
392394
<div class="section" id="bug-tracker">
393-
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
395+
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
394396
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/project/issues">GitHub Issues</a>.
395397
In case of trouble, please check there if your issue has already been reported.
396-
If you spotted it first, help us smashing it by providing a detailed and welcomed
398+
If you spotted it first, help us to smash it by providing a detailed and welcomed
397399
<a class="reference external" href="https://github.com/OCA/project/issues/new?body=module:%20project_task_name_with_id%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
398400
<p>Do not contact contributors directly about support or help with technical issues.</p>
399401
</div>
400402
<div class="section" id="credits">
401-
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
403+
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
402404
<div class="section" id="authors">
403-
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
405+
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
404406
<ul class="simple">
405407
<li>Quartile Limited</li>
406408
</ul>
407409
</div>
408410
<div class="section" id="maintainers">
409-
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
411+
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
410412
<p>This module is maintained by the OCA.</p>
411413
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
412414
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose

project_task_name_with_id/tests/test_project_task_id.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright 2023 Quartile Limited
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
33

4+
import re
5+
46
from odoo.tests.common import TransactionCase
57

68

@@ -29,4 +31,7 @@ def test_name_get(self):
2931
# Test the new name_get method
3032
name_get = self.project_task.name_get()[0]
3133
self.assertEqual(name_get[0], self.project_task.id)
32-
self.assertEqual(name_get[1], f"[{self.project_task.id}] Test task")
34+
task_id = self.project_task.id
35+
# Checking for the task ID and "Test task" anywhere in the string
36+
pattern = re.compile(rf"\[{task_id}\].*Test task")
37+
self.assertTrue(pattern.search(name_get[1]))

0 commit comments

Comments
 (0)