Skip to content
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

[16.0][MIG] project_task_code : alternative without functionality change #1209

Merged
merged 53 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
9727e87
[MOD] changing from odoomrp to avanzosc
oihane Oct 30, 2014
afee2fe
[FIX] Code error when copying a task
oihane Dec 2, 2014
3086c28
[IMP] <project_task_code> adapted to OCA
oihane Jul 30, 2015
11ee2ba
[IMP] <project_task_code> Added docstring to pre and post init-hooks
oihane Aug 3, 2015
b73c83e
[UPD] prefix versions with 8.0
sbidoul Oct 9, 2015
f44edee
[MIG] Make modules uninstallable
pedrobaeza Oct 14, 2015
6ad0f61
[MIG] Rename manifest files
pedrobaeza Oct 6, 2016
8c4c534
project_task_code module
cubells Dec 17, 2016
8fd4630
[MIG] project_task_code: Migrate to 10.0
Dec 17, 2016
60e14bb
Requested README changes
Jan 12, 2017
80eecde
Requested XML change
Jan 12, 2017
0264550
OCA Transbot updated translations from Transifex
oca-transbot Sep 1, 2015
a447ed9
[MIG] project_task_code: Migration to 11.0
rodrigets Feb 16, 2018
ad72d6f
[IMP] Implements name_get() in 'project.task'
rodrigets Apr 16, 2018
e4e9ff1
remove obsolete .pot files [ci skip]
sbidoul Jun 15, 2018
f4bca13
[UPD] Update project_task_code.pot
oca-travis Jun 18, 2018
e4a81ec
[MIG] project_task_code: Migration to 12.0
bouvyd Oct 29, 2018
b0b78cd
[MIG] project_task_code: Migration to 12.0 (fix)
alexey-pelykh Nov 21, 2018
1049025
[UPD] Update project_task_code.pot
oca-travis Nov 27, 2018
b28cd9f
Update translation files
oca-transbot Dec 9, 2018
b0450ed
[FIX] project_task_code: invalid variable
alexey-pelykh Feb 11, 2019
25672f4
Translated using Weblate (Galician)
mvrodriguez Feb 11, 2019
965a5ae
[ADD] icon.png
OCA-git-bot Apr 3, 2019
b61fac7
[FIX][12.0] project_task_code missing api.multi
tbaden Apr 30, 2019
c961145
[UPD] README.rst
OCA-git-bot Jul 29, 2019
d5e6190
[13.0][MIG] project_task_code
Saran440 Oct 24, 2019
d5c601e
[UPD] Update project_task_code.pot
oca-travis Oct 28, 2019
3517c22
Update translation files
oca-transbot Dec 25, 2019
a6c1e90
pre-commit update
OCA-git-bot Mar 14, 2020
a77dd19
[UPD] Brainbean Apps => CorporateHub
alexey-pelykh Nov 8, 2020
51ccca1
[UPD] README.rst
OCA-git-bot Nov 8, 2020
7cb9fae
[14.0][MIG]project_task_code
Yoshiro009 Jan 27, 2021
c14ea12
[UPD] Update project_task_code.pot
oca-travis Mar 3, 2021
86d6e99
[UPD] README.rst
OCA-git-bot Mar 3, 2021
af7f011
Added translation using Weblate (Spanish (Argentina))
ibuioli Apr 1, 2021
80c4489
Translated using Weblate (Spanish (Argentina))
ibuioli Apr 1, 2021
8d67233
Added translation using Weblate (French (France))
Yvesldff Apr 11, 2021
67f1578
Translated using Weblate (French (France))
Yvesldff Apr 11, 2021
a45a624
Translated using Weblate (Spanish (Mexico))
alan196 Sep 29, 2021
8e05c8e
Translated using Weblate (Swedish)
simonstromb Nov 16, 2021
8d695a7
[MIG] project_task_code : Migrate project_task_code.
bizzappdev Feb 9, 2022
3917981
[UPD] Update project_task_code.pot
Apr 5, 2022
1fa12b2
[UPD] README.rst
OCA-git-bot Apr 5, 2022
a473195
Translated using Weblate (Catalan)
Noel000 Apr 13, 2022
eb2e122
[FIX] project_task_code: in place argument modification
gurneyalex Oct 10, 2022
0ef2e4d
project_task_code 15.0.1.0.2
OCA-git-bot Oct 10, 2022
3b668d7
[15.0][FIX] project_task_code: Fix null value in column code, that vi…
yankinmax Nov 22, 2022
de2f16e
project_task_code 15.0.1.0.3
OCA-git-bot Dec 1, 2022
772df0d
[IMP] update dotfiles [ci skip]
OCA-git-bot Dec 11, 2022
5cfdc38
[FIX] project_task_code: Make sequence avalaible for all companies
rolandojduartem Jan 13, 2023
d71ca2f
project_task_code 15.0.1.0.4
OCA-git-bot Jan 24, 2023
95494ab
[MIG] project_task_code: Migration to 16.0
kg-ucs Nov 2, 2022
2ca302e
[FIX] project_task_code: unique code in company
robinkeunen Jan 11, 2024
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
108 changes: 108 additions & 0 deletions project_task_code/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
=========================
Sequential Code for Tasks
=========================

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

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

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

This module adds a sequential code for tasks.

**Table of contents**

.. contents::
:local:

Configuration
=============

To change the task code sequence, you must:

#. Activate the developer mode.
#. Go to Settings > Technical > Sequences & Identifiers > Sequences.
#. Click on "Task code" sequence to edit.

Usage
=====

To use this module, you need to:

#. Go to menu Project > Search > Tasks and create a new task, and you get a
new code saving it.
#. If you duplicate a task, you will get a new code for the new task.

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_code%0Aversion:%2016.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
~~~~~~~

* OdooMRP team
* AvanzOSC
* Tecnativa

Contributors
~~~~~~~~~~~~

* Oihane Crucelaegui <[email protected]>
* Pedro M. Baeza <[email protected]>
* Ana Juaristi <[email protected]>
* Vicent Cubells <[email protected]>
* Rodrigo Ferreira <[email protected]>
* Damien Bouvy <[email protected]>
* `CorporateHub <https://corporatehub.eu/>`__

* Alexey Pelykh <[email protected]>

* Saran Lim. <[email protected]>
* Tharathip Chaweewongphan <[email protected]>
* Ruchir Shukla <[email protected]>

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/16.0/project_task_code>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions project_task_code/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from .hooks import pre_init_hook
from .hooks import post_init_hook
24 changes: 24 additions & 0 deletions project_task_code/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2016 Tecnativa <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Sequential Code for Tasks",
"version": "16.0.1.0.0",
"category": "Project Management",
"author": "OdooMRP team, "
"AvanzOSC, "
"Tecnativa, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/project",
"license": "AGPL-3",
"depends": [
"project",
],
"data": [
"data/task_sequence.xml",
"views/project_view.xml",
],
"installable": True,
"pre_init_hook": "pre_init_hook",
"post_init_hook": "post_init_hook",
}
13 changes: 13 additions & 0 deletions project_task_code/data/task_sequence.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo noupdate="1">
<!--
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<record id="sequence_task" model="ir.sequence">
<field name="name">Task code</field>
<field name="code">project.task</field>
<field eval="4" name="padding" />
<field name="prefix">T</field>
<field name="company_id" eval="False" />
</record>
</odoo>
33 changes: 33 additions & 0 deletions project_task_code/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2016 Tecnativa <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import SUPERUSER_ID, api


def pre_init_hook(cr):
"""
With this pre-init-hook we want to avoid error when creating the UNIQUE
code constraint when the module is installed and before the post-init-hook
is launched.
"""
cr.execute("ALTER TABLE project_task ADD COLUMN code character varying;")
cr.execute("UPDATE project_task SET code = id;")


def post_init_hook(cr, registry):
"""
This post-init-hook will update all existing task assigning them the
corresponding sequence code.
"""
env = api.Environment(cr, SUPERUSER_ID, dict())
task_obj = env["project.task"]
sequence_obj = env["ir.sequence"]
tasks = task_obj.search([], order="id")
for task_id in tasks.ids:
cr.execute(
"UPDATE project_task SET code = %s WHERE id = %s;",
(
sequence_obj.next_by_code("project.task"),
task_id,
),
)
37 changes: 37 additions & 0 deletions project_task_code/i18n/ar.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_code
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: project (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-31 18:04+0000\n"
"PO-Revision-Date: 2015-08-06 21:48+0000\n"
"Last-Translator: <>\n"
"Language-Team: Arabic (http://www.transifex.com/oca/OCA-project-8-0/language/"
"ar/)\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#. module: project_task_code
#: model:ir.model,name:project_task_code.model_project_task
msgid "Task"
msgstr "مهمة"

#. module: project_task_code
#: model:ir.model.fields,field_description:project_task_code.field_project_task__code
msgid "Task Number"
msgstr ""

#. module: project_task_code
#: code:addons/project_task_code/models/project_task.py:0
#: model:ir.model.constraint,message:project_task_code.constraint_project_task_project_task_unique_code
#, python-format
msgid "The code must be unique!"
msgstr ""
36 changes: 36 additions & 0 deletions project_task_code/i18n/bg.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_code
#
# Translators:
# OCA Transbot <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-23 03:43+0000\n"
"PO-Revision-Date: 2016-12-23 03:43+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
"Language-Team: Bulgarian (https://www.transifex.com/oca/teams/23907/bg/)\n"
"Language: bg\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"

#. module: project_task_code
#: model:ir.model,name:project_task_code.model_project_task
msgid "Task"
msgstr ""

#. module: project_task_code
#: model:ir.model.fields,field_description:project_task_code.field_project_task__code
msgid "Task Number"
msgstr ""

#. module: project_task_code
#: code:addons/project_task_code/models/project_task.py:0
#: model:ir.model.constraint,message:project_task_code.constraint_project_task_project_task_unique_code
#, python-format
msgid "The code must be unique!"
msgstr "Номерът трябва да е уникален!"
37 changes: 37 additions & 0 deletions project_task_code/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_code
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: project (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-31 18:04+0000\n"
"PO-Revision-Date: 2022-04-13 11:05+0000\n"
"Last-Translator: Noel estudillo <[email protected]>\n"
"Language-Team: Catalan (http://www.transifex.com/oca/OCA-project-8-0/"
"language/ca/)\n"
"Language: ca\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.3.2\n"

#. module: project_task_code
#: model:ir.model,name:project_task_code.model_project_task
msgid "Task"
msgstr "Tasca"

#. module: project_task_code
#: model:ir.model.fields,field_description:project_task_code.field_project_task__code
msgid "Task Number"
msgstr "Número de tasca"

#. module: project_task_code
#: code:addons/project_task_code/models/project_task.py:0
#: model:ir.model.constraint,message:project_task_code.constraint_project_task_project_task_unique_code
#, python-format
msgid "The code must be unique!"
msgstr "El codi ha de ser únic!"
36 changes: 36 additions & 0 deletions project_task_code/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_code
#
# Translators:
# OCA Transbot <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-23 03:43+0000\n"
"PO-Revision-Date: 2016-12-23 03:43+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"Language: de\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"

#. module: project_task_code
#: model:ir.model,name:project_task_code.model_project_task
msgid "Task"
msgstr "Aufgabe"

#. module: project_task_code
#: model:ir.model.fields,field_description:project_task_code.field_project_task__code
msgid "Task Number"
msgstr "Aufgaben Nummer"

#. module: project_task_code
#: code:addons/project_task_code/models/project_task.py:0
#: model:ir.model.constraint,message:project_task_code.constraint_project_task_project_task_unique_code
#, python-format
msgid "The code must be unique!"
msgstr "Der Schlüssel muss eindeutig sein!"
36 changes: 36 additions & 0 deletions project_task_code/i18n/el.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_code
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: project (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-31 18:04+0000\n"
"PO-Revision-Date: 2015-08-06 21:48+0000\n"
"Last-Translator: <>\n"
"Language-Team: Greek (http://www.transifex.com/oca/OCA-project-8-0/language/"
"el/)\n"
"Language: el\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"

#. module: project_task_code
#: model:ir.model,name:project_task_code.model_project_task
msgid "Task"
msgstr "Εργασία"

#. module: project_task_code
#: model:ir.model.fields,field_description:project_task_code.field_project_task__code
msgid "Task Number"
msgstr ""

#. module: project_task_code
#: code:addons/project_task_code/models/project_task.py:0
#: model:ir.model.constraint,message:project_task_code.constraint_project_task_project_task_unique_code
#, python-format
msgid "The code must be unique!"
msgstr ""
Loading
Loading