Skip to content

Commit dc799f5

Browse files
committed
Merge PR #1209 into 16.0
Signed-off-by rafaelbn
2 parents 63031e5 + 2ca302e commit dc799f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2181
-0
lines changed

project_task_code/README.rst

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
=========================
2+
Sequential Code for Tasks
3+
=========================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:307ec89a5cd1e0a62f1559f57457a183b12100fee6f01a43caca5324a80c3d00
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github
20+
:target: https://github.com/OCA/project/tree/16.0/project_task_code
21+
:alt: OCA/project
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_code
24+
:alt: Translate me on Weblate
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
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module adds a sequential code for tasks.
32+
33+
**Table of contents**
34+
35+
.. contents::
36+
:local:
37+
38+
Configuration
39+
=============
40+
41+
To change the task code sequence, you must:
42+
43+
#. Activate the developer mode.
44+
#. Go to Settings > Technical > Sequences & Identifiers > Sequences.
45+
#. Click on "Task code" sequence to edit.
46+
47+
Usage
48+
=====
49+
50+
To use this module, you need to:
51+
52+
#. Go to menu Project > Search > Tasks and create a new task, and you get a
53+
new code saving it.
54+
#. If you duplicate a task, you will get a new code for the new task.
55+
56+
Bug Tracker
57+
===========
58+
59+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/project/issues>`_.
60+
In case of trouble, please check there if your issue has already been reported.
61+
If you spotted it first, help us to smash it by providing a detailed and welcomed
62+
`feedback <https://github.com/OCA/project/issues/new?body=module:%20project_task_code%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
63+
64+
Do not contact contributors directly about support or help with technical issues.
65+
66+
Credits
67+
=======
68+
69+
Authors
70+
~~~~~~~
71+
72+
* OdooMRP team
73+
* AvanzOSC
74+
* Tecnativa
75+
76+
Contributors
77+
~~~~~~~~~~~~
78+
79+
* Oihane Crucelaegui <[email protected]>
80+
* Pedro M. Baeza <[email protected]>
81+
* Ana Juaristi <[email protected]>
82+
* Vicent Cubells <[email protected]>
83+
* Rodrigo Ferreira <[email protected]>
84+
* Damien Bouvy <[email protected]>
85+
* `CorporateHub <https://corporatehub.eu/>`__
86+
87+
* Alexey Pelykh <[email protected]>
88+
89+
* Saran Lim. <[email protected]>
90+
* Tharathip Chaweewongphan <[email protected]>
91+
* Ruchir Shukla <[email protected]>
92+
93+
Maintainers
94+
~~~~~~~~~~~
95+
96+
This module is maintained by the OCA.
97+
98+
.. image:: https://odoo-community.org/logo.png
99+
:alt: Odoo Community Association
100+
:target: https://odoo-community.org
101+
102+
OCA, or the Odoo Community Association, is a nonprofit organization whose
103+
mission is to support the collaborative development of Odoo features and
104+
promote its widespread use.
105+
106+
This module is part of the `OCA/project <https://github.com/OCA/project/tree/16.0/project_task_code>`_ project on GitHub.
107+
108+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

project_task_code/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
2+
3+
from . import models
4+
from .hooks import pre_init_hook
5+
from .hooks import post_init_hook

project_task_code/__manifest__.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2016 Tecnativa <[email protected]>
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Sequential Code for Tasks",
6+
"version": "16.0.1.0.0",
7+
"category": "Project Management",
8+
"author": "OdooMRP team, "
9+
"AvanzOSC, "
10+
"Tecnativa, "
11+
"Odoo Community Association (OCA)",
12+
"website": "https://github.com/OCA/project",
13+
"license": "AGPL-3",
14+
"depends": [
15+
"project",
16+
],
17+
"data": [
18+
"data/task_sequence.xml",
19+
"views/project_view.xml",
20+
],
21+
"installable": True,
22+
"pre_init_hook": "pre_init_hook",
23+
"post_init_hook": "post_init_hook",
24+
}
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<odoo noupdate="1">
3+
<!--
4+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
5+
-->
6+
<record id="sequence_task" model="ir.sequence">
7+
<field name="name">Task code</field>
8+
<field name="code">project.task</field>
9+
<field eval="4" name="padding" />
10+
<field name="prefix">T</field>
11+
<field name="company_id" eval="False" />
12+
</record>
13+
</odoo>

project_task_code/hooks.py

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright 2016 Tecnativa <[email protected]>
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import SUPERUSER_ID, api
5+
6+
7+
def pre_init_hook(cr):
8+
"""
9+
With this pre-init-hook we want to avoid error when creating the UNIQUE
10+
code constraint when the module is installed and before the post-init-hook
11+
is launched.
12+
"""
13+
cr.execute("ALTER TABLE project_task ADD COLUMN code character varying;")
14+
cr.execute("UPDATE project_task SET code = id;")
15+
16+
17+
def post_init_hook(cr, registry):
18+
"""
19+
This post-init-hook will update all existing task assigning them the
20+
corresponding sequence code.
21+
"""
22+
env = api.Environment(cr, SUPERUSER_ID, dict())
23+
task_obj = env["project.task"]
24+
sequence_obj = env["ir.sequence"]
25+
tasks = task_obj.search([], order="id")
26+
for task_id in tasks.ids:
27+
cr.execute(
28+
"UPDATE project_task SET code = %s WHERE id = %s;",
29+
(
30+
sequence_obj.next_by_code("project.task"),
31+
task_id,
32+
),
33+
)

project_task_code/i18n/ar.po

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * project_task_code
4+
#
5+
# Translators:
6+
msgid ""
7+
msgstr ""
8+
"Project-Id-Version: project (8.0)\n"
9+
"Report-Msgid-Bugs-To: \n"
10+
"POT-Creation-Date: 2015-08-31 18:04+0000\n"
11+
"PO-Revision-Date: 2015-08-06 21:48+0000\n"
12+
"Last-Translator: <>\n"
13+
"Language-Team: Arabic (http://www.transifex.com/oca/OCA-project-8-0/language/"
14+
"ar/)\n"
15+
"Language: ar\n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: \n"
19+
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
20+
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
21+
22+
#. module: project_task_code
23+
#: model:ir.model,name:project_task_code.model_project_task
24+
msgid "Task"
25+
msgstr "مهمة"
26+
27+
#. module: project_task_code
28+
#: model:ir.model.fields,field_description:project_task_code.field_project_task__code
29+
msgid "Task Number"
30+
msgstr ""
31+
32+
#. module: project_task_code
33+
#: code:addons/project_task_code/models/project_task.py:0
34+
#: model:ir.model.constraint,message:project_task_code.constraint_project_task_project_task_unique_code
35+
#, python-format
36+
msgid "The code must be unique!"
37+
msgstr ""

project_task_code/i18n/bg.po

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * project_task_code
4+
#
5+
# Translators:
6+
# OCA Transbot <[email protected]>, 2016
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: Odoo Server 9.0c\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2016-12-23 03:43+0000\n"
12+
"PO-Revision-Date: 2016-12-23 03:43+0000\n"
13+
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
14+
"Language-Team: Bulgarian (https://www.transifex.com/oca/teams/23907/bg/)\n"
15+
"Language: bg\n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: \n"
19+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
20+
21+
#. module: project_task_code
22+
#: model:ir.model,name:project_task_code.model_project_task
23+
msgid "Task"
24+
msgstr ""
25+
26+
#. module: project_task_code
27+
#: model:ir.model.fields,field_description:project_task_code.field_project_task__code
28+
msgid "Task Number"
29+
msgstr ""
30+
31+
#. module: project_task_code
32+
#: code:addons/project_task_code/models/project_task.py:0
33+
#: model:ir.model.constraint,message:project_task_code.constraint_project_task_project_task_unique_code
34+
#, python-format
35+
msgid "The code must be unique!"
36+
msgstr "Номерът трябва да е уникален!"

project_task_code/i18n/ca.po

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * project_task_code
4+
#
5+
# Translators:
6+
msgid ""
7+
msgstr ""
8+
"Project-Id-Version: project (8.0)\n"
9+
"Report-Msgid-Bugs-To: \n"
10+
"POT-Creation-Date: 2015-08-31 18:04+0000\n"
11+
"PO-Revision-Date: 2022-04-13 11:05+0000\n"
12+
"Last-Translator: Noel estudillo <[email protected]>\n"
13+
"Language-Team: Catalan (http://www.transifex.com/oca/OCA-project-8-0/"
14+
"language/ca/)\n"
15+
"Language: ca\n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: \n"
19+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
20+
"X-Generator: Weblate 4.3.2\n"
21+
22+
#. module: project_task_code
23+
#: model:ir.model,name:project_task_code.model_project_task
24+
msgid "Task"
25+
msgstr "Tasca"
26+
27+
#. module: project_task_code
28+
#: model:ir.model.fields,field_description:project_task_code.field_project_task__code
29+
msgid "Task Number"
30+
msgstr "Número de tasca"
31+
32+
#. module: project_task_code
33+
#: code:addons/project_task_code/models/project_task.py:0
34+
#: model:ir.model.constraint,message:project_task_code.constraint_project_task_project_task_unique_code
35+
#, python-format
36+
msgid "The code must be unique!"
37+
msgstr "El codi ha de ser únic!"

project_task_code/i18n/de.po

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * project_task_code
4+
#
5+
# Translators:
6+
# OCA Transbot <[email protected]>, 2016
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: Odoo Server 9.0c\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2016-12-23 03:43+0000\n"
12+
"PO-Revision-Date: 2016-12-23 03:43+0000\n"
13+
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
14+
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
15+
"Language: de\n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: \n"
19+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
20+
21+
#. module: project_task_code
22+
#: model:ir.model,name:project_task_code.model_project_task
23+
msgid "Task"
24+
msgstr "Aufgabe"
25+
26+
#. module: project_task_code
27+
#: model:ir.model.fields,field_description:project_task_code.field_project_task__code
28+
msgid "Task Number"
29+
msgstr "Aufgaben Nummer"
30+
31+
#. module: project_task_code
32+
#: code:addons/project_task_code/models/project_task.py:0
33+
#: model:ir.model.constraint,message:project_task_code.constraint_project_task_project_task_unique_code
34+
#, python-format
35+
msgid "The code must be unique!"
36+
msgstr "Der Schlüssel muss eindeutig sein!"

project_task_code/i18n/el.po

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * project_task_code
4+
#
5+
# Translators:
6+
msgid ""
7+
msgstr ""
8+
"Project-Id-Version: project (8.0)\n"
9+
"Report-Msgid-Bugs-To: \n"
10+
"POT-Creation-Date: 2015-08-31 18:04+0000\n"
11+
"PO-Revision-Date: 2015-08-06 21:48+0000\n"
12+
"Last-Translator: <>\n"
13+
"Language-Team: Greek (http://www.transifex.com/oca/OCA-project-8-0/language/"
14+
"el/)\n"
15+
"Language: el\n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: \n"
19+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
20+
21+
#. module: project_task_code
22+
#: model:ir.model,name:project_task_code.model_project_task
23+
msgid "Task"
24+
msgstr "Εργασία"
25+
26+
#. module: project_task_code
27+
#: model:ir.model.fields,field_description:project_task_code.field_project_task__code
28+
msgid "Task Number"
29+
msgstr ""
30+
31+
#. module: project_task_code
32+
#: code:addons/project_task_code/models/project_task.py:0
33+
#: model:ir.model.constraint,message:project_task_code.constraint_project_task_project_task_unique_code
34+
#, python-format
35+
msgid "The code must be unique!"
36+
msgstr ""

0 commit comments

Comments
 (0)