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

[15.0][MIG] project_key #1257

Open
wants to merge 46 commits into
base: 15.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9fb52bb
ADD: Adding module project_key
pnajman-modoolar Feb 23, 2018
5c4b4f7
[UPD] Update project_key.pot
oca-travis Jun 18, 2018
dfd4920
[FIX] Copying projects
tarteo Sep 6, 2018
96637af
[UPD] Update project_key.pot
oca-travis Sep 6, 2018
207f830
[MIG] project_key: Migration to 12.0
alexey-pelykh Nov 19, 2018
6fbc102
[UPD] Update project_key.pot
oca-travis Nov 24, 2018
e3fa3b7
[IMP] project_key: do not regenerate project key if it's already set
alexey-pelykh Nov 26, 2018
3929b24
[UPD] Update project_key.pot
oca-travis Nov 26, 2018
70daad9
[FIX][12.0] project_key relative path
tbaden Apr 30, 2019
e45c5af
project_key: add test context key
ernestotejeda May 21, 2019
28d5c30
[UPD] Update project_key.pot
oca-travis May 22, 2019
fbe3b96
Added translation using Weblate (German)
marylla Jul 9, 2019
3a71750
Translated using Weblate (German)
marylla Jul 9, 2019
17e2b5f
Translated using Weblate (German)
marylla Jul 12, 2019
574295e
[UPD] README.rst
OCA-git-bot Jul 29, 2019
f492714
[IMP] project_key: black, isort
Saran440 Dec 20, 2019
fd58d07
[13.0][MIG] project_key
Saran440 Dec 20, 2019
e9673fa
[UPD] Update project_key.pot
oca-travis Mar 10, 2020
a608b3e
pre-commit update
OCA-git-bot Mar 14, 2020
195d6ff
Update translation files
oca-transbot Mar 14, 2020
0223096
[FIX] project_key: avoid index out of range error on project key gene…
skeller1 Nov 7, 2020
54b8469
[UPD] Brainbean Apps => CorporateHub
alexey-pelykh Nov 8, 2020
a3c63d3
[UPD] README.rst
OCA-git-bot Nov 8, 2020
1b503d6
project_key 13.0.1.0.1
OCA-git-bot Nov 10, 2020
e41f8fe
[IMP] project_key: black, isort, prettier
newtratip Feb 21, 2021
48b0066
[MIG] project_key: Migration to 14.0
newtratip Feb 22, 2021
6275b38
[UPD] Update project_key.pot
oca-travis Mar 3, 2021
dbdefce
[UPD] README.rst
OCA-git-bot Mar 3, 2021
b99937f
Added translation using Weblate (Spanish (Argentina))
ibuioli Apr 1, 2021
8a9e0ba
Translated using Weblate (Spanish (Argentina))
ibuioli Apr 1, 2021
784ebd6
Added translation using Weblate (French (France))
Yvesldff Apr 11, 2021
f093be5
Translated using Weblate (French (France))
Yvesldff Apr 11, 2021
c98de48
Added translation using Weblate (French)
Yvesldff May 14, 2021
39ce626
Translated using Weblate (French)
Yvesldff May 14, 2021
b931957
project_key: fix controller tests
simahawk Aug 20, 2021
58dc997
project_key: boost tests
simahawk Aug 20, 2021
120329b
project_key 14.0.1.0.1
OCA-git-bot Aug 20, 2021
76022dc
try fixing CI
petrus-v Nov 26, 2021
2bfa047
[IMP] add function to generate unique project key automatically.
yweng8111 Aug 25, 2022
018635b
project_key 14.0.1.0.2
OCA-git-bot Aug 25, 2022
ea46ea9
Added translation using Weblate (Italian)
primes2h Oct 19, 2022
a5f43dc
Translated using Weblate (Italian)
primes2h Oct 19, 2022
8c26f51
[IMP] project_key: black, isort, prettier
eferriere Jan 18, 2023
04d7062
[MIG] project_key: Migration to 15.0
eferriere Jan 18, 2023
9ac09fe
The key sequences to create stories and tasks with keys, created with
eferriere Jan 31, 2023
1dcea64
[FIX] project_key: fix tests
vincent-hatakeyama Aug 27, 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
118 changes: 118 additions & 0 deletions project_key/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
===========
Project key
===========

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github
:target: https://github.com/OCA/project/tree/15.0/project_key
:alt: OCA/project
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_key
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/140/15.0
:alt: Try me on Runbot

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

This module provides functionality to uniquely identify projects and tasks by simple ``key`` field.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module functionality you just need to:

On ``project.project`` level:

In Kanban View:

#. Go to Project > Dashboard
#. Create
#. Enter project name and use auto generated key or simply override value by entering your own key value.

In Tree View:

#. Go to Project > Configuration > Projects
#. Create
#. Enter project name and use auto generated key or simply override value by entering your own key value.

In form View:

#. Go to Project > Dashboard
#. Open the projects settings
#. Modify the "key" value
#. After modifying project key the key of any existing tasks related to that project will be updated automatically.

When you create a project, under the hood a ir.sequence record gets creted with prefix: ``<project-key>-``.

On ``project.task`` level:

#. Actually there is nothing to be done here
#. Task keys are auto generated based on project key value with per project auto incremented number (i.e. PA-1, PA-2, etc)

In browser address bar:

#. Navigate to your project by entering following url: http://<<your-domain>>/projects/PROJECT-KEY
#. Navigate to your task by entering following url: http://<<your-domain>>/tasks/TASK-KEY

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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/project/issues/new?body=module:%20project_key%0Aversion:%2015.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
~~~~~~~

* Modoolar

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

* Petar Najman <[email protected]>
* Sladjan Kantar <[email protected]>
* `CorporateHub <https://corporatehub.eu/>`__

* Alexey Pelykh <[email protected]>

* Saran Lim. <[email protected]>
* Tharathip Chaweewongphan <[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/15.0/project_key>`_ 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_key/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).

from . import models
from . import controllers
from .hooks import post_init_hook
15 changes: 15 additions & 0 deletions project_key/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2017 - 2018 Modoolar <[email protected]>
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).

{
"name": "Project key",
"summary": "Module decorates projects and tasks with Project Key",
"category": "Project",
"version": "15.0.1.0.0",
"license": "LGPL-3",
"author": "Modoolar, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/project",
"depends": ["project"],
"data": ["views/project_key_views.xml"],
"post_init_hook": "post_init_hook",
}
3 changes: 3 additions & 0 deletions project_key/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).

from . import main
41 changes: 41 additions & 0 deletions project_key/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2017 - 2018 Modoolar <[email protected]>
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).

import werkzeug

from odoo import http

# from odoo.http import request


class ProjectBrowser(http.Controller):
def get_record_url(self, model, domain, action_xml_id):
env = http.request.env()

records = env[model].search(domain)
record_id = records and records.id or -1
action_id = env.ref(action_xml_id).id

return "/web#id={}&view_type=form&model={}&action={}".format(
record_id, model, action_id
)

def get_task_url(self, key):
return self.get_record_url(
"project.task", [("key", "=ilike", key)], "project.action_view_task"
)

def get_project_url(self, key):
return self.get_record_url(
"project.project",
[("key", "=ilike", key)],
"project.open_view_project_all_config",
)

@http.route(["/projects/<string:key>"], type="http", auth="user")
def open_project(self, key, **kwargs):
return werkzeug.utils.redirect(self.get_project_url(key), 301)

@http.route(["/tasks/<string:key>"], type="http", auth="user")
def open_task(self, key, **kwargs):
return werkzeug.utils.redirect(self.get_task_url(key), 301)
9 changes: 9 additions & 0 deletions project_key/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2017 - 2018 Modoolar <[email protected]>
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).


def post_init_hook(cr, registry):
from odoo import SUPERUSER_ID, api

env = api.Environment(cr, SUPERUSER_ID, {})
env["project.project"]._set_default_project_key()
63 changes: 63 additions & 0 deletions project_key/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_key
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-07-12 15:43+0000\n"
"Last-Translator: Maria Sparenberg <[email protected]>\n"
"Language-Team: none\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"
"X-Generator: Weblate 3.7.1\n"

#. module: project_key
#: model:ir.model.fields,field_description:project_key.field_project_project__key
msgid "Key"
msgstr "Nummerierungsmuster"

#. module: project_key
#: model:ir.model.fields,field_description:project_key.field_project_project__task_key_sequence_id
msgid "Key Sequence"
msgstr "Musterfolge"

#. module: project_key
#: model:ir.model,name:project_key.model_project_project
msgid "Project"
msgstr "Projekt"

#. module: project_key
#: model:ir.model.constraint,message:project_key.constraint_project_project_project_key_unique
msgid "Project key must be unique"
msgstr "Das Nummerierungsmuster für Projekte muss eindeutig sein."

#. module: project_key
#: code:addons/project_key/models/project_project.py:0
#, python-format
msgid "Project task sequence for project "
msgstr "Aufgabennummerierung für Projekt "

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

#. module: project_key
#: model:ir.model.constraint,message:project_key.constraint_project_task_task_key_unique
msgid "Task key must be unique!"
msgstr "Aufgabennummerierung muss eindeutig sein!"

#. module: project_key
#: model:ir.model.fields,field_description:project_key.field_project_task__url
msgid "URL"
msgstr "URL"

#. module: project_key
#: model:ir.model.fields,field_description:project_key.field_project_task__key
msgid "key"
msgstr "Nummer"
81 changes: 81 additions & 0 deletions project_key/i18n/es_AR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_key
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-04-01 03:48+0000\n"
"Last-Translator: Ignacio Buioli <[email protected]>\n"
"Language-Team: none\n"
"Language: es_AR\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_key
#: model:ir.model.fields,field_description:project_key.field_project_project__display_name
#: model:ir.model.fields,field_description:project_key.field_project_task__display_name
msgid "Display Name"
msgstr "Mostrar Nombre"

#. module: project_key
#: model:ir.model.fields,field_description:project_key.field_project_project__id
#: model:ir.model.fields,field_description:project_key.field_project_task__id
msgid "ID"
msgstr "ID"

#. module: project_key
#: model:ir.model.fields,field_description:project_key.field_project_project__key
msgid "Key"
msgstr "Clave"

#. module: project_key
#: model:ir.model.fields,field_description:project_key.field_project_project__task_key_sequence_id
msgid "Key Sequence"
msgstr "Secuencia de la Clave"

#. module: project_key
#: model:ir.model.fields,field_description:project_key.field_project_project____last_update
#: model:ir.model.fields,field_description:project_key.field_project_task____last_update
msgid "Last Modified on"
msgstr "Última Modificación el"

#. module: project_key
#: model:ir.model,name:project_key.model_project_project
msgid "Project"
msgstr "Proyecto"

#. module: project_key
#: model:ir.model.constraint,message:project_key.constraint_project_project_project_key_unique
msgid "Project key must be unique"
msgstr "La clave del proyecto debe ser única"

#. module: project_key
#: code:addons/project_key/models/project_project.py:0
#, python-format
msgid "Project task sequence for project"
msgstr "Secuencia de tareas del proyecto para el proyecto"

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

#. module: project_key
#: model:ir.model.constraint,message:project_key.constraint_project_task_task_key_unique
msgid "Task key must be unique!"
msgstr "¡La clave de la tarea debe ser única!"

#. module: project_key
#: model:ir.model.fields,field_description:project_key.field_project_task__url
msgid "URL"
msgstr "URL"

#. module: project_key
#: model:ir.model.fields,field_description:project_key.field_project_task__key
msgid "key"
msgstr "clave"
Loading
Loading