odoo-addon-project-task-default-user 18.0.1.0.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odoo/addons/project_task_default_user/README.rst +120 -0
- odoo/addons/project_task_default_user/__init__.py +1 -0
- odoo/addons/project_task_default_user/__manifest__.py +21 -0
- odoo/addons/project_task_default_user/i18n/project_task_default_user.pot +86 -0
- odoo/addons/project_task_default_user/models/__init__.py +5 -0
- odoo/addons/project_task_default_user/models/project_project.py +33 -0
- odoo/addons/project_task_default_user/models/project_task.py +53 -0
- odoo/addons/project_task_default_user/models/project_task_type.py +33 -0
- odoo/addons/project_task_default_user/readme/CONFIGURE.md +5 -0
- odoo/addons/project_task_default_user/readme/CONTRIBUTORS.md +2 -0
- odoo/addons/project_task_default_user/readme/DESCRIPTION.md +7 -0
- odoo/addons/project_task_default_user/static/description/icon.png +0 -0
- odoo/addons/project_task_default_user/static/description/index.html +466 -0
- odoo/addons/project_task_default_user/tests/__init__.py +1 -0
- odoo/addons/project_task_default_user/tests/test_project_task_default_user.py +129 -0
- odoo/addons/project_task_default_user/views/project_project_views.xml +24 -0
- odoo/addons/project_task_default_user/views/project_task_type_views.xml +29 -0
- odoo_addon_project_task_default_user-18.0.1.0.0.2.dist-info/METADATA +136 -0
- odoo_addon_project_task_default_user-18.0.1.0.0.2.dist-info/RECORD +21 -0
- odoo_addon_project_task_default_user-18.0.1.0.0.2.dist-info/WHEEL +5 -0
- odoo_addon_project_task_default_user-18.0.1.0.0.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
.. image:: https://odoo-community.org/readme-banner-image
|
|
2
|
+
:target: https://odoo-community.org/get-involved?utm_source=readme
|
|
3
|
+
:alt: Odoo Community Association
|
|
4
|
+
|
|
5
|
+
=========================
|
|
6
|
+
Project Task Default User
|
|
7
|
+
=========================
|
|
8
|
+
|
|
9
|
+
..
|
|
10
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
11
|
+
!! This file is generated by oca-gen-addon-readme !!
|
|
12
|
+
!! changes will be overwritten. !!
|
|
13
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
14
|
+
!! source digest: sha256:2b00bf26a2b4a420fcca734cb4c09820c5f24d00842a28575c17437c96897c4d
|
|
15
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
16
|
+
|
|
17
|
+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
18
|
+
:target: https://odoo-community.org/page/development-status
|
|
19
|
+
:alt: Beta
|
|
20
|
+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
|
|
21
|
+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
|
22
|
+
:alt: License: AGPL-3
|
|
23
|
+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github
|
|
24
|
+
:target: https://github.com/OCA/project/tree/18.0/project_task_default_user
|
|
25
|
+
:alt: OCA/project
|
|
26
|
+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
27
|
+
:target: https://translation.odoo-community.org/projects/project-18-0/project-18-0-project_task_default_user
|
|
28
|
+
:alt: Translate me on Weblate
|
|
29
|
+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
|
30
|
+
:target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=18.0
|
|
31
|
+
:alt: Try me on Runboat
|
|
32
|
+
|
|
33
|
+
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
34
|
+
|
|
35
|
+
This module automatically assigns default users to tasks.
|
|
36
|
+
|
|
37
|
+
- Stage-based assignment (priority rule): When creating a task or
|
|
38
|
+
changing its stage to one with default users, those users are
|
|
39
|
+
automatically assigned according to the stage’s assignment mode
|
|
40
|
+
(replace or merge). Stage-based defaults always take priority over
|
|
41
|
+
project defaults.
|
|
42
|
+
- Project-based fallback: If the stage does not define any default
|
|
43
|
+
users, project default users are applied using the same assignment
|
|
44
|
+
mode logic (replace or merge).
|
|
45
|
+
- Assignment behavior: The assignment mode controls how users are
|
|
46
|
+
applied:
|
|
47
|
+
|
|
48
|
+
- replace: replaces existing task users with default users
|
|
49
|
+
- merge: adds default users to the existing task users without
|
|
50
|
+
removing them
|
|
51
|
+
|
|
52
|
+
- Multiple default users supported: Both project and stage can define
|
|
53
|
+
multiple default users.
|
|
54
|
+
|
|
55
|
+
**Table of contents**
|
|
56
|
+
|
|
57
|
+
.. contents::
|
|
58
|
+
:local:
|
|
59
|
+
|
|
60
|
+
Configuration
|
|
61
|
+
=============
|
|
62
|
+
|
|
63
|
+
To use this module, you need to:
|
|
64
|
+
|
|
65
|
+
1. Open Project settings and set default users in the "Default Users"
|
|
66
|
+
tab and configure the assignment mode.
|
|
67
|
+
2. Activate developer mode.
|
|
68
|
+
3. Go to Project → Configuration → Task Stages, set default users in the
|
|
69
|
+
"Default Users for this Stage" field and configure the assignment
|
|
70
|
+
mode.
|
|
71
|
+
|
|
72
|
+
Bug Tracker
|
|
73
|
+
===========
|
|
74
|
+
|
|
75
|
+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/project/issues>`_.
|
|
76
|
+
In case of trouble, please check there if your issue has already been reported.
|
|
77
|
+
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
78
|
+
`feedback <https://github.com/OCA/project/issues/new?body=module:%20project_task_default_user%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
79
|
+
|
|
80
|
+
Do not contact contributors directly about support or help with technical issues.
|
|
81
|
+
|
|
82
|
+
Credits
|
|
83
|
+
=======
|
|
84
|
+
|
|
85
|
+
Authors
|
|
86
|
+
-------
|
|
87
|
+
|
|
88
|
+
* NICO SOLUTIONS - ENGINEERING & IT
|
|
89
|
+
|
|
90
|
+
Contributors
|
|
91
|
+
------------
|
|
92
|
+
|
|
93
|
+
- `NICO SOLUTIONS - ENGINEERING & IT <https://www.nico-solutions.de>`__:
|
|
94
|
+
|
|
95
|
+
- Nils Coenen <nils.coenen@nico-solutions.de>
|
|
96
|
+
|
|
97
|
+
Maintainers
|
|
98
|
+
-----------
|
|
99
|
+
|
|
100
|
+
This module is maintained by the OCA.
|
|
101
|
+
|
|
102
|
+
.. image:: https://odoo-community.org/logo.png
|
|
103
|
+
:alt: Odoo Community Association
|
|
104
|
+
:target: https://odoo-community.org
|
|
105
|
+
|
|
106
|
+
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
107
|
+
mission is to support the collaborative development of Odoo features and
|
|
108
|
+
promote its widespread use.
|
|
109
|
+
|
|
110
|
+
.. |maintainer-NICO-SOLUTIONS| image:: https://github.com/NICO-SOLUTIONS.png?size=40px
|
|
111
|
+
:target: https://github.com/NICO-SOLUTIONS
|
|
112
|
+
:alt: NICO-SOLUTIONS
|
|
113
|
+
|
|
114
|
+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
|
115
|
+
|
|
116
|
+
|maintainer-NICO-SOLUTIONS|
|
|
117
|
+
|
|
118
|
+
This module is part of the `OCA/project <https://github.com/OCA/project/tree/18.0/project_task_default_user>`_ project on GitHub.
|
|
119
|
+
|
|
120
|
+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from . import models
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Copyright 2025 NICO SOLUTIONS - ENGINEERING & IT
|
|
2
|
+
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
3
|
+
|
|
4
|
+
{
|
|
5
|
+
"name": "Project Task Default User",
|
|
6
|
+
"summary": "Auto assign default users to tasks or when changing task stages",
|
|
7
|
+
"version": "18.0.1.0.0",
|
|
8
|
+
"category": "Project",
|
|
9
|
+
"author": "NICO SOLUTIONS - ENGINEERING & IT, Odoo Community Association (OCA)",
|
|
10
|
+
"maintainers": ["NICO-SOLUTIONS"],
|
|
11
|
+
"website": "https://github.com/OCA/project",
|
|
12
|
+
"depends": ["project"],
|
|
13
|
+
"data": [
|
|
14
|
+
"views/project_project_views.xml",
|
|
15
|
+
"views/project_task_type_views.xml",
|
|
16
|
+
],
|
|
17
|
+
"license": "AGPL-3",
|
|
18
|
+
"installable": True,
|
|
19
|
+
"application": False,
|
|
20
|
+
"auto_install": False,
|
|
21
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Translation of Odoo Server.
|
|
2
|
+
# This file contains the translation of the following modules:
|
|
3
|
+
# * project_task_default_user
|
|
4
|
+
#
|
|
5
|
+
msgid ""
|
|
6
|
+
msgstr ""
|
|
7
|
+
"Project-Id-Version: Odoo Server 18.0\n"
|
|
8
|
+
"Report-Msgid-Bugs-To: \n"
|
|
9
|
+
"Last-Translator: \n"
|
|
10
|
+
"Language-Team: \n"
|
|
11
|
+
"MIME-Version: 1.0\n"
|
|
12
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
13
|
+
"Content-Transfer-Encoding: \n"
|
|
14
|
+
"Plural-Forms: \n"
|
|
15
|
+
|
|
16
|
+
#. module: project_task_default_user
|
|
17
|
+
#: model:ir.model.fields,field_description:project_task_default_user.field_project_project__default_user_ids
|
|
18
|
+
msgid "Default Users for Tasks"
|
|
19
|
+
msgstr ""
|
|
20
|
+
|
|
21
|
+
#. module: project_task_default_user
|
|
22
|
+
#: model:ir.model.fields,field_description:project_task_default_user.field_project_task_type__default_user_ids
|
|
23
|
+
msgid "Default Users for this Stage"
|
|
24
|
+
msgstr ""
|
|
25
|
+
|
|
26
|
+
#. module: project_task_default_user
|
|
27
|
+
#: model_terms:ir.ui.view,arch_db:project_task_default_user.project_edit_project_inherit_default_user
|
|
28
|
+
msgid "Default users"
|
|
29
|
+
msgstr ""
|
|
30
|
+
|
|
31
|
+
#. module: project_task_default_user
|
|
32
|
+
#: model:ir.model.fields,help:project_task_default_user.field_project_project__project_task_assignment_mode
|
|
33
|
+
#: model:ir.model.fields,help:project_task_default_user.field_project_task_type__stage_task_assignment_mode
|
|
34
|
+
msgid ""
|
|
35
|
+
"Defines how default users are applied:\n"
|
|
36
|
+
"- Replace: overwrite existing users\n"
|
|
37
|
+
"- Merge: add default users to existing ones\n"
|
|
38
|
+
"\n"
|
|
39
|
+
"Applied on task creation and stage changes."
|
|
40
|
+
msgstr ""
|
|
41
|
+
|
|
42
|
+
#. module: project_task_default_user
|
|
43
|
+
#: model:ir.model.fields,help:project_task_default_user.field_project_project__default_user_ids
|
|
44
|
+
#: model:ir.model.fields,help:project_task_default_user.field_project_task_type__default_user_ids
|
|
45
|
+
msgid ""
|
|
46
|
+
"If set, tasks will automatically be assigned to these users. On new tasks, "
|
|
47
|
+
"this applies if no users are set. On stage change, the users are replaced "
|
|
48
|
+
"only if the new stage has default users."
|
|
49
|
+
msgstr ""
|
|
50
|
+
|
|
51
|
+
#. module: project_task_default_user
|
|
52
|
+
#: model:ir.model.fields.selection,name:project_task_default_user.selection__project_project__project_task_assignment_mode__merge
|
|
53
|
+
#: model:ir.model.fields.selection,name:project_task_default_user.selection__project_task_type__stage_task_assignment_mode__merge
|
|
54
|
+
msgid "Merge"
|
|
55
|
+
msgstr ""
|
|
56
|
+
|
|
57
|
+
#. module: project_task_default_user
|
|
58
|
+
#: model:ir.model,name:project_task_default_user.model_project_project
|
|
59
|
+
msgid "Project"
|
|
60
|
+
msgstr ""
|
|
61
|
+
|
|
62
|
+
#. module: project_task_default_user
|
|
63
|
+
#: model:ir.model.fields,field_description:project_task_default_user.field_project_project__project_task_assignment_mode
|
|
64
|
+
msgid "Project Task Assignment Mode"
|
|
65
|
+
msgstr ""
|
|
66
|
+
|
|
67
|
+
#. module: project_task_default_user
|
|
68
|
+
#: model:ir.model.fields.selection,name:project_task_default_user.selection__project_project__project_task_assignment_mode__replace
|
|
69
|
+
#: model:ir.model.fields.selection,name:project_task_default_user.selection__project_task_type__stage_task_assignment_mode__replace
|
|
70
|
+
msgid "Replace"
|
|
71
|
+
msgstr ""
|
|
72
|
+
|
|
73
|
+
#. module: project_task_default_user
|
|
74
|
+
#: model:ir.model.fields,field_description:project_task_default_user.field_project_task_type__stage_task_assignment_mode
|
|
75
|
+
msgid "Stage Task Assignment Mode"
|
|
76
|
+
msgstr ""
|
|
77
|
+
|
|
78
|
+
#. module: project_task_default_user
|
|
79
|
+
#: model:ir.model,name:project_task_default_user.model_project_task
|
|
80
|
+
msgid "Task"
|
|
81
|
+
msgstr ""
|
|
82
|
+
|
|
83
|
+
#. module: project_task_default_user
|
|
84
|
+
#: model:ir.model,name:project_task_default_user.model_project_task_type
|
|
85
|
+
msgid "Task Stage"
|
|
86
|
+
msgstr ""
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Copyright 2025 NICO SOLUTIONS - ENGINEERING & IT
|
|
2
|
+
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
3
|
+
|
|
4
|
+
from odoo import fields, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ProjectProject(models.Model):
|
|
8
|
+
_inherit = "project.project"
|
|
9
|
+
|
|
10
|
+
default_user_ids = fields.Many2many(
|
|
11
|
+
"res.users",
|
|
12
|
+
string="Default Users for Tasks",
|
|
13
|
+
domain=lambda self: [
|
|
14
|
+
("groups_id", "in", [self.env.ref("project.group_project_user").id])
|
|
15
|
+
],
|
|
16
|
+
help="If set, tasks will automatically be assigned to these users. "
|
|
17
|
+
"On new tasks, this applies if no users are set. On stage change, "
|
|
18
|
+
"the users are replaced only if the new stage has default users.",
|
|
19
|
+
)
|
|
20
|
+
project_task_assignment_mode = fields.Selection(
|
|
21
|
+
[
|
|
22
|
+
("replace", "Replace"),
|
|
23
|
+
("merge", "Merge"),
|
|
24
|
+
],
|
|
25
|
+
default="replace",
|
|
26
|
+
help=(
|
|
27
|
+
"Defines how default users are applied:\n"
|
|
28
|
+
"- Replace: overwrite existing users\n"
|
|
29
|
+
"- Merge: add default users to existing ones\n"
|
|
30
|
+
"\n"
|
|
31
|
+
"Applied on task creation and stage changes."
|
|
32
|
+
),
|
|
33
|
+
)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Copyright 2025 NICO SOLUTIONS - ENGINEERING & IT
|
|
2
|
+
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
3
|
+
|
|
4
|
+
from odoo import Command, api, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ProjectTask(models.Model):
|
|
8
|
+
_inherit = "project.task"
|
|
9
|
+
|
|
10
|
+
@api.model_create_multi
|
|
11
|
+
def create(self, vals_list):
|
|
12
|
+
tasks = super().create(vals_list)
|
|
13
|
+
for task in tasks:
|
|
14
|
+
default_users, mode = task._get_default_users_and_mode()
|
|
15
|
+
if default_users:
|
|
16
|
+
task._apply_default_users(default_users, mode)
|
|
17
|
+
|
|
18
|
+
return tasks
|
|
19
|
+
|
|
20
|
+
def write(self, vals):
|
|
21
|
+
res = super().write(vals)
|
|
22
|
+
if "stage_id" in vals:
|
|
23
|
+
for task in self:
|
|
24
|
+
default_users, mode = task._get_default_users_and_mode()
|
|
25
|
+
if default_users:
|
|
26
|
+
task._apply_default_users(default_users, mode)
|
|
27
|
+
|
|
28
|
+
return res
|
|
29
|
+
|
|
30
|
+
def _get_default_users_and_mode(self):
|
|
31
|
+
self.ensure_one()
|
|
32
|
+
if self.stage_id and self.stage_id.default_user_ids:
|
|
33
|
+
return (
|
|
34
|
+
self.stage_id.default_user_ids.ids,
|
|
35
|
+
self.stage_id.stage_task_assignment_mode or "replace",
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
if self.project_id and self.project_id.default_user_ids:
|
|
39
|
+
return (
|
|
40
|
+
self.project_id.default_user_ids.ids,
|
|
41
|
+
self.project_id.project_task_assignment_mode or "replace",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
return None, "replace"
|
|
45
|
+
|
|
46
|
+
def _apply_default_users(self, default_users, mode):
|
|
47
|
+
self.ensure_one()
|
|
48
|
+
if mode == "merge":
|
|
49
|
+
existing = self.user_ids.ids or []
|
|
50
|
+
merged = list(dict.fromkeys(existing + default_users))
|
|
51
|
+
self.user_ids = [Command.set(merged)]
|
|
52
|
+
else:
|
|
53
|
+
self.user_ids = [Command.set(default_users)]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Copyright 2025 NICO SOLUTIONS - ENGINEERING & IT
|
|
2
|
+
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
|
|
3
|
+
|
|
4
|
+
from odoo import fields, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ProjectTaskType(models.Model):
|
|
8
|
+
_inherit = "project.task.type"
|
|
9
|
+
|
|
10
|
+
default_user_ids = fields.Many2many(
|
|
11
|
+
"res.users",
|
|
12
|
+
string="Default Users for this Stage",
|
|
13
|
+
domain=lambda self: [
|
|
14
|
+
("groups_id", "in", [self.env.ref("project.group_project_user").id])
|
|
15
|
+
],
|
|
16
|
+
help="If set, tasks will automatically be assigned to these users. "
|
|
17
|
+
"On new tasks, this applies if no users are set. On stage change, "
|
|
18
|
+
"the users are replaced only if the new stage has default users.",
|
|
19
|
+
)
|
|
20
|
+
stage_task_assignment_mode = fields.Selection(
|
|
21
|
+
[
|
|
22
|
+
("replace", "Replace"),
|
|
23
|
+
("merge", "Merge"),
|
|
24
|
+
],
|
|
25
|
+
default="replace",
|
|
26
|
+
help=(
|
|
27
|
+
"Defines how default users are applied:\n"
|
|
28
|
+
"- Replace: overwrite existing users\n"
|
|
29
|
+
"- Merge: add default users to existing ones\n"
|
|
30
|
+
"\n"
|
|
31
|
+
"Applied on task creation and stage changes."
|
|
32
|
+
),
|
|
33
|
+
)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
To use this module, you need to:
|
|
2
|
+
|
|
3
|
+
1. Open Project settings and set default users in the "Default Users" tab and configure the assignment mode.
|
|
4
|
+
2. Activate developer mode.
|
|
5
|
+
3. Go to Project → Configuration → Task Stages, set default users in the "Default Users for this Stage" field and configure the assignment mode.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
This module automatically assigns default users to tasks.
|
|
2
|
+
- Stage-based assignment (priority rule): When creating a task or changing its stage to one with default users, those users are automatically assigned according to the stage’s assignment mode (replace or merge). Stage-based defaults always take priority over project defaults.
|
|
3
|
+
- Project-based fallback: If the stage does not define any default users, project default users are applied using the same assignment mode logic (replace or merge).
|
|
4
|
+
- Assignment behavior: The assignment mode controls how users are applied:
|
|
5
|
+
- replace: replaces existing task users with default users
|
|
6
|
+
- merge: adds default users to the existing task users without removing them
|
|
7
|
+
- Multiple default users supported: Both project and stage can define multiple default users.
|
|
Binary file
|
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
|
+
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
|
6
|
+
<title>README.rst</title>
|
|
7
|
+
<style type="text/css">
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
:Author: David Goodger (goodger@python.org)
|
|
11
|
+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
|
12
|
+
:Copyright: This stylesheet has been placed in the public domain.
|
|
13
|
+
|
|
14
|
+
Default cascading style sheet for the HTML output of Docutils.
|
|
15
|
+
Despite the name, some widely supported CSS2 features are used.
|
|
16
|
+
|
|
17
|
+
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
|
18
|
+
customize this style sheet.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/* used to remove borders from tables and images */
|
|
22
|
+
.borderless, table.borderless td, table.borderless th {
|
|
23
|
+
border: 0 }
|
|
24
|
+
|
|
25
|
+
table.borderless td, table.borderless th {
|
|
26
|
+
/* Override padding for "table.docutils td" with "! important".
|
|
27
|
+
The right padding separates the table cells. */
|
|
28
|
+
padding: 0 0.5em 0 0 ! important }
|
|
29
|
+
|
|
30
|
+
.first {
|
|
31
|
+
/* Override more specific margin styles with "! important". */
|
|
32
|
+
margin-top: 0 ! important }
|
|
33
|
+
|
|
34
|
+
.last, .with-subtitle {
|
|
35
|
+
margin-bottom: 0 ! important }
|
|
36
|
+
|
|
37
|
+
.hidden {
|
|
38
|
+
display: none }
|
|
39
|
+
|
|
40
|
+
.subscript {
|
|
41
|
+
vertical-align: sub;
|
|
42
|
+
font-size: smaller }
|
|
43
|
+
|
|
44
|
+
.superscript {
|
|
45
|
+
vertical-align: super;
|
|
46
|
+
font-size: smaller }
|
|
47
|
+
|
|
48
|
+
a.toc-backref {
|
|
49
|
+
text-decoration: none ;
|
|
50
|
+
color: black }
|
|
51
|
+
|
|
52
|
+
blockquote.epigraph {
|
|
53
|
+
margin: 2em 5em ; }
|
|
54
|
+
|
|
55
|
+
dl.docutils dd {
|
|
56
|
+
margin-bottom: 0.5em }
|
|
57
|
+
|
|
58
|
+
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
|
63
|
+
dl.docutils dt {
|
|
64
|
+
font-weight: bold }
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
div.abstract {
|
|
68
|
+
margin: 2em 5em }
|
|
69
|
+
|
|
70
|
+
div.abstract p.topic-title {
|
|
71
|
+
font-weight: bold ;
|
|
72
|
+
text-align: center }
|
|
73
|
+
|
|
74
|
+
div.admonition, div.attention, div.caution, div.danger, div.error,
|
|
75
|
+
div.hint, div.important, div.note, div.tip, div.warning {
|
|
76
|
+
margin: 2em ;
|
|
77
|
+
border: medium outset ;
|
|
78
|
+
padding: 1em }
|
|
79
|
+
|
|
80
|
+
div.admonition p.admonition-title, div.hint p.admonition-title,
|
|
81
|
+
div.important p.admonition-title, div.note p.admonition-title,
|
|
82
|
+
div.tip p.admonition-title {
|
|
83
|
+
font-weight: bold ;
|
|
84
|
+
font-family: sans-serif }
|
|
85
|
+
|
|
86
|
+
div.attention p.admonition-title, div.caution p.admonition-title,
|
|
87
|
+
div.danger p.admonition-title, div.error p.admonition-title,
|
|
88
|
+
div.warning p.admonition-title, .code .error {
|
|
89
|
+
color: red ;
|
|
90
|
+
font-weight: bold ;
|
|
91
|
+
font-family: sans-serif }
|
|
92
|
+
|
|
93
|
+
/* Uncomment (and remove this text!) to get reduced vertical space in
|
|
94
|
+
compound paragraphs.
|
|
95
|
+
div.compound .compound-first, div.compound .compound-middle {
|
|
96
|
+
margin-bottom: 0.5em }
|
|
97
|
+
|
|
98
|
+
div.compound .compound-last, div.compound .compound-middle {
|
|
99
|
+
margin-top: 0.5em }
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
div.dedication {
|
|
103
|
+
margin: 2em 5em ;
|
|
104
|
+
text-align: center ;
|
|
105
|
+
font-style: italic }
|
|
106
|
+
|
|
107
|
+
div.dedication p.topic-title {
|
|
108
|
+
font-weight: bold ;
|
|
109
|
+
font-style: normal }
|
|
110
|
+
|
|
111
|
+
div.figure {
|
|
112
|
+
margin-left: 2em ;
|
|
113
|
+
margin-right: 2em }
|
|
114
|
+
|
|
115
|
+
div.footer, div.header {
|
|
116
|
+
clear: both;
|
|
117
|
+
font-size: smaller }
|
|
118
|
+
|
|
119
|
+
div.line-block {
|
|
120
|
+
display: block ;
|
|
121
|
+
margin-top: 1em ;
|
|
122
|
+
margin-bottom: 1em }
|
|
123
|
+
|
|
124
|
+
div.line-block div.line-block {
|
|
125
|
+
margin-top: 0 ;
|
|
126
|
+
margin-bottom: 0 ;
|
|
127
|
+
margin-left: 1.5em }
|
|
128
|
+
|
|
129
|
+
div.sidebar {
|
|
130
|
+
margin: 0 0 0.5em 1em ;
|
|
131
|
+
border: medium outset ;
|
|
132
|
+
padding: 1em ;
|
|
133
|
+
background-color: #ffffee ;
|
|
134
|
+
width: 40% ;
|
|
135
|
+
float: right ;
|
|
136
|
+
clear: right }
|
|
137
|
+
|
|
138
|
+
div.sidebar p.rubric {
|
|
139
|
+
font-family: sans-serif ;
|
|
140
|
+
font-size: medium }
|
|
141
|
+
|
|
142
|
+
div.system-messages {
|
|
143
|
+
margin: 5em }
|
|
144
|
+
|
|
145
|
+
div.system-messages h1 {
|
|
146
|
+
color: red }
|
|
147
|
+
|
|
148
|
+
div.system-message {
|
|
149
|
+
border: medium outset ;
|
|
150
|
+
padding: 1em }
|
|
151
|
+
|
|
152
|
+
div.system-message p.system-message-title {
|
|
153
|
+
color: red ;
|
|
154
|
+
font-weight: bold }
|
|
155
|
+
|
|
156
|
+
div.topic {
|
|
157
|
+
margin: 2em }
|
|
158
|
+
|
|
159
|
+
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
|
160
|
+
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
|
161
|
+
margin-top: 0.4em }
|
|
162
|
+
|
|
163
|
+
h1.title {
|
|
164
|
+
text-align: center }
|
|
165
|
+
|
|
166
|
+
h2.subtitle {
|
|
167
|
+
text-align: center }
|
|
168
|
+
|
|
169
|
+
hr.docutils {
|
|
170
|
+
width: 75% }
|
|
171
|
+
|
|
172
|
+
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
|
173
|
+
clear: left ;
|
|
174
|
+
float: left ;
|
|
175
|
+
margin-right: 1em }
|
|
176
|
+
|
|
177
|
+
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
|
178
|
+
clear: right ;
|
|
179
|
+
float: right ;
|
|
180
|
+
margin-left: 1em }
|
|
181
|
+
|
|
182
|
+
img.align-center, .figure.align-center, object.align-center {
|
|
183
|
+
display: block;
|
|
184
|
+
margin-left: auto;
|
|
185
|
+
margin-right: auto;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
table.align-center {
|
|
189
|
+
margin-left: auto;
|
|
190
|
+
margin-right: auto;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.align-left {
|
|
194
|
+
text-align: left }
|
|
195
|
+
|
|
196
|
+
.align-center {
|
|
197
|
+
clear: both ;
|
|
198
|
+
text-align: center }
|
|
199
|
+
|
|
200
|
+
.align-right {
|
|
201
|
+
text-align: right }
|
|
202
|
+
|
|
203
|
+
/* reset inner alignment in figures */
|
|
204
|
+
div.align-right {
|
|
205
|
+
text-align: inherit }
|
|
206
|
+
|
|
207
|
+
/* div.align-center * { */
|
|
208
|
+
/* text-align: left } */
|
|
209
|
+
|
|
210
|
+
.align-top {
|
|
211
|
+
vertical-align: top }
|
|
212
|
+
|
|
213
|
+
.align-middle {
|
|
214
|
+
vertical-align: middle }
|
|
215
|
+
|
|
216
|
+
.align-bottom {
|
|
217
|
+
vertical-align: bottom }
|
|
218
|
+
|
|
219
|
+
ol.simple, ul.simple {
|
|
220
|
+
margin-bottom: 1em }
|
|
221
|
+
|
|
222
|
+
ol.arabic {
|
|
223
|
+
list-style: decimal }
|
|
224
|
+
|
|
225
|
+
ol.loweralpha {
|
|
226
|
+
list-style: lower-alpha }
|
|
227
|
+
|
|
228
|
+
ol.upperalpha {
|
|
229
|
+
list-style: upper-alpha }
|
|
230
|
+
|
|
231
|
+
ol.lowerroman {
|
|
232
|
+
list-style: lower-roman }
|
|
233
|
+
|
|
234
|
+
ol.upperroman {
|
|
235
|
+
list-style: upper-roman }
|
|
236
|
+
|
|
237
|
+
p.attribution {
|
|
238
|
+
text-align: right ;
|
|
239
|
+
margin-left: 50% }
|
|
240
|
+
|
|
241
|
+
p.caption {
|
|
242
|
+
font-style: italic }
|
|
243
|
+
|
|
244
|
+
p.credits {
|
|
245
|
+
font-style: italic ;
|
|
246
|
+
font-size: smaller }
|
|
247
|
+
|
|
248
|
+
p.label {
|
|
249
|
+
white-space: nowrap }
|
|
250
|
+
|
|
251
|
+
p.rubric {
|
|
252
|
+
font-weight: bold ;
|
|
253
|
+
font-size: larger ;
|
|
254
|
+
color: maroon ;
|
|
255
|
+
text-align: center }
|
|
256
|
+
|
|
257
|
+
p.sidebar-title {
|
|
258
|
+
font-family: sans-serif ;
|
|
259
|
+
font-weight: bold ;
|
|
260
|
+
font-size: larger }
|
|
261
|
+
|
|
262
|
+
p.sidebar-subtitle {
|
|
263
|
+
font-family: sans-serif ;
|
|
264
|
+
font-weight: bold }
|
|
265
|
+
|
|
266
|
+
p.topic-title {
|
|
267
|
+
font-weight: bold }
|
|
268
|
+
|
|
269
|
+
pre.address {
|
|
270
|
+
margin-bottom: 0 ;
|
|
271
|
+
margin-top: 0 ;
|
|
272
|
+
font: inherit }
|
|
273
|
+
|
|
274
|
+
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|
275
|
+
margin-left: 2em ;
|
|
276
|
+
margin-right: 2em }
|
|
277
|
+
|
|
278
|
+
pre.code .ln { color: gray; } /* line numbers */
|
|
279
|
+
pre.code, code { background-color: #eeeeee }
|
|
280
|
+
pre.code .comment, code .comment { color: #5C6576 }
|
|
281
|
+
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
|
282
|
+
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
|
283
|
+
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
|
284
|
+
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
|
285
|
+
pre.code .inserted, code .inserted { background-color: #A3D289}
|
|
286
|
+
|
|
287
|
+
span.classifier {
|
|
288
|
+
font-family: sans-serif ;
|
|
289
|
+
font-style: oblique }
|
|
290
|
+
|
|
291
|
+
span.classifier-delimiter {
|
|
292
|
+
font-family: sans-serif ;
|
|
293
|
+
font-weight: bold }
|
|
294
|
+
|
|
295
|
+
span.interpreted {
|
|
296
|
+
font-family: sans-serif }
|
|
297
|
+
|
|
298
|
+
span.option {
|
|
299
|
+
white-space: nowrap }
|
|
300
|
+
|
|
301
|
+
span.pre {
|
|
302
|
+
white-space: pre }
|
|
303
|
+
|
|
304
|
+
span.problematic, pre.problematic {
|
|
305
|
+
color: red }
|
|
306
|
+
|
|
307
|
+
span.section-subtitle {
|
|
308
|
+
/* font-size relative to parent (h1..h6 element) */
|
|
309
|
+
font-size: 80% }
|
|
310
|
+
|
|
311
|
+
table.citation {
|
|
312
|
+
border-left: solid 1px gray;
|
|
313
|
+
margin-left: 1px }
|
|
314
|
+
|
|
315
|
+
table.docinfo {
|
|
316
|
+
margin: 2em 4em }
|
|
317
|
+
|
|
318
|
+
table.docutils {
|
|
319
|
+
margin-top: 0.5em ;
|
|
320
|
+
margin-bottom: 0.5em }
|
|
321
|
+
|
|
322
|
+
table.footnote {
|
|
323
|
+
border-left: solid 1px black;
|
|
324
|
+
margin-left: 1px }
|
|
325
|
+
|
|
326
|
+
table.docutils td, table.docutils th,
|
|
327
|
+
table.docinfo td, table.docinfo th {
|
|
328
|
+
padding-left: 0.5em ;
|
|
329
|
+
padding-right: 0.5em ;
|
|
330
|
+
vertical-align: top }
|
|
331
|
+
|
|
332
|
+
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
|
333
|
+
font-weight: bold ;
|
|
334
|
+
text-align: left ;
|
|
335
|
+
white-space: nowrap ;
|
|
336
|
+
padding-left: 0 }
|
|
337
|
+
|
|
338
|
+
/* "booktabs" style (no vertical lines) */
|
|
339
|
+
table.docutils.booktabs {
|
|
340
|
+
border: 0px;
|
|
341
|
+
border-top: 2px solid;
|
|
342
|
+
border-bottom: 2px solid;
|
|
343
|
+
border-collapse: collapse;
|
|
344
|
+
}
|
|
345
|
+
table.docutils.booktabs * {
|
|
346
|
+
border: 0px;
|
|
347
|
+
}
|
|
348
|
+
table.docutils.booktabs th {
|
|
349
|
+
border-bottom: thin solid;
|
|
350
|
+
text-align: left;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
|
354
|
+
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
|
355
|
+
font-size: 100% }
|
|
356
|
+
|
|
357
|
+
ul.auto-toc {
|
|
358
|
+
list-style-type: none }
|
|
359
|
+
|
|
360
|
+
</style>
|
|
361
|
+
</head>
|
|
362
|
+
<body>
|
|
363
|
+
<div class="document">
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
|
|
367
|
+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
|
|
368
|
+
</a>
|
|
369
|
+
<div class="section" id="project-task-default-user">
|
|
370
|
+
<h1>Project Task Default User</h1>
|
|
371
|
+
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
372
|
+
!! This file is generated by oca-gen-addon-readme !!
|
|
373
|
+
!! changes will be overwritten. !!
|
|
374
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
375
|
+
!! source digest: sha256:2b00bf26a2b4a420fcca734cb4c09820c5f24d00842a28575c17437c96897c4d
|
|
376
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
377
|
+
<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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/project/tree/18.0/project_task_default_user"><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-18-0/project-18-0-project_task_default_user"><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&target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
378
|
+
<p>This module automatically assigns default users to tasks.</p>
|
|
379
|
+
<ul class="simple">
|
|
380
|
+
<li>Stage-based assignment (priority rule): When creating a task or
|
|
381
|
+
changing its stage to one with default users, those users are
|
|
382
|
+
automatically assigned according to the stage’s assignment mode
|
|
383
|
+
(replace or merge). Stage-based defaults always take priority over
|
|
384
|
+
project defaults.</li>
|
|
385
|
+
<li>Project-based fallback: If the stage does not define any default
|
|
386
|
+
users, project default users are applied using the same assignment
|
|
387
|
+
mode logic (replace or merge).</li>
|
|
388
|
+
<li>Assignment behavior: The assignment mode controls how users are
|
|
389
|
+
applied:<ul>
|
|
390
|
+
<li>replace: replaces existing task users with default users</li>
|
|
391
|
+
<li>merge: adds default users to the existing task users without
|
|
392
|
+
removing them</li>
|
|
393
|
+
</ul>
|
|
394
|
+
</li>
|
|
395
|
+
<li>Multiple default users supported: Both project and stage can define
|
|
396
|
+
multiple default users.</li>
|
|
397
|
+
</ul>
|
|
398
|
+
<p><strong>Table of contents</strong></p>
|
|
399
|
+
<div class="contents local topic" id="contents">
|
|
400
|
+
<ul class="simple">
|
|
401
|
+
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
|
|
402
|
+
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
|
|
403
|
+
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
|
|
404
|
+
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
|
|
405
|
+
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
|
|
406
|
+
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
|
|
407
|
+
</ul>
|
|
408
|
+
</li>
|
|
409
|
+
</ul>
|
|
410
|
+
</div>
|
|
411
|
+
<div class="section" id="configuration">
|
|
412
|
+
<h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
|
|
413
|
+
<p>To use this module, you need to:</p>
|
|
414
|
+
<ol class="arabic simple">
|
|
415
|
+
<li>Open Project settings and set default users in the “Default Users”
|
|
416
|
+
tab and configure the assignment mode.</li>
|
|
417
|
+
<li>Activate developer mode.</li>
|
|
418
|
+
<li>Go to Project → Configuration → Task Stages, set default users in the
|
|
419
|
+
“Default Users for this Stage” field and configure the assignment
|
|
420
|
+
mode.</li>
|
|
421
|
+
</ol>
|
|
422
|
+
</div>
|
|
423
|
+
<div class="section" id="bug-tracker">
|
|
424
|
+
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
|
|
425
|
+
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/project/issues">GitHub Issues</a>.
|
|
426
|
+
In case of trouble, please check there if your issue has already been reported.
|
|
427
|
+
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
428
|
+
<a class="reference external" href="https://github.com/OCA/project/issues/new?body=module:%20project_task_default_user%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
|
429
|
+
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
|
430
|
+
</div>
|
|
431
|
+
<div class="section" id="credits">
|
|
432
|
+
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
|
|
433
|
+
<div class="section" id="authors">
|
|
434
|
+
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
|
|
435
|
+
<ul class="simple">
|
|
436
|
+
<li>NICO SOLUTIONS - ENGINEERING & IT</li>
|
|
437
|
+
</ul>
|
|
438
|
+
</div>
|
|
439
|
+
<div class="section" id="contributors">
|
|
440
|
+
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
|
|
441
|
+
<ul class="simple">
|
|
442
|
+
<li><a class="reference external" href="https://www.nico-solutions.de">NICO SOLUTIONS - ENGINEERING & IT</a>:<ul>
|
|
443
|
+
<li>Nils Coenen <<a class="reference external" href="mailto:nils.coenen@nico-solutions.de">nils.coenen@nico-solutions.de</a>></li>
|
|
444
|
+
</ul>
|
|
445
|
+
</li>
|
|
446
|
+
</ul>
|
|
447
|
+
</div>
|
|
448
|
+
<div class="section" id="maintainers">
|
|
449
|
+
<h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
|
|
450
|
+
<p>This module is maintained by the OCA.</p>
|
|
451
|
+
<a class="reference external image-reference" href="https://odoo-community.org">
|
|
452
|
+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
|
453
|
+
</a>
|
|
454
|
+
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
455
|
+
mission is to support the collaborative development of Odoo features and
|
|
456
|
+
promote its widespread use.</p>
|
|
457
|
+
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
|
458
|
+
<p><a class="reference external image-reference" href="https://github.com/NICO-SOLUTIONS"><img alt="NICO-SOLUTIONS" src="https://github.com/NICO-SOLUTIONS.png?size=40px" /></a></p>
|
|
459
|
+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/project/tree/18.0/project_task_default_user">OCA/project</a> project on GitHub.</p>
|
|
460
|
+
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
|
461
|
+
</div>
|
|
462
|
+
</div>
|
|
463
|
+
</div>
|
|
464
|
+
</div>
|
|
465
|
+
</body>
|
|
466
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from . import test_project_task_default_user
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
from odoo.tests.common import TransactionCase
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class TestProjectTaskDefaultUser(TransactionCase):
|
|
5
|
+
@classmethod
|
|
6
|
+
def setUpClass(cls):
|
|
7
|
+
super().setUpClass()
|
|
8
|
+
env = cls.env
|
|
9
|
+
|
|
10
|
+
cls.user1 = env["res.users"].create(
|
|
11
|
+
{"name": "User 1", "login": "user1", "email": "user1@example.com"}
|
|
12
|
+
)
|
|
13
|
+
cls.user2 = env["res.users"].create(
|
|
14
|
+
{"name": "User 2", "login": "user2", "email": "user2@example.com"}
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
cls.project_with_default = env["project.project"].create(
|
|
18
|
+
{
|
|
19
|
+
"name": "Project with Default",
|
|
20
|
+
"default_user_ids": [(6, 0, [cls.user1.id])],
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
cls.project_without_default = env["project.project"].create(
|
|
25
|
+
{
|
|
26
|
+
"name": "Project without Default",
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
cls.stage_with_default = env["project.task.type"].create(
|
|
31
|
+
{
|
|
32
|
+
"name": "Stage with Default",
|
|
33
|
+
"default_user_ids": [(6, 0, [cls.user2.id])],
|
|
34
|
+
"project_ids": [(6, 0, [cls.project_with_default.id])],
|
|
35
|
+
"stage_task_assignment_mode": "replace",
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
cls.stage_without_default = env["project.task.type"].create(
|
|
40
|
+
{
|
|
41
|
+
"name": "Stage without Default",
|
|
42
|
+
"project_ids": [(6, 0, [cls.project_with_default.id])],
|
|
43
|
+
"stage_task_assignment_mode": "replace",
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
def test_create_task_stage_default(self):
|
|
48
|
+
task = self.env["project.task"].create(
|
|
49
|
+
{
|
|
50
|
+
"name": "Task Stage Default",
|
|
51
|
+
"project_id": self.project_with_default.id,
|
|
52
|
+
"stage_id": self.stage_with_default.id,
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
self.assertEqual(task.user_ids.ids, [self.user2.id])
|
|
56
|
+
|
|
57
|
+
def test_create_task_project_default(self):
|
|
58
|
+
task = self.env["project.task"].create(
|
|
59
|
+
{
|
|
60
|
+
"name": "Task Project Default",
|
|
61
|
+
"project_id": self.project_with_default.id,
|
|
62
|
+
"stage_id": self.stage_without_default.id,
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
self.assertEqual(task.user_ids.ids, [self.user1.id])
|
|
66
|
+
|
|
67
|
+
def test_create_task_no_default(self):
|
|
68
|
+
task = self.env["project.task"].create(
|
|
69
|
+
{
|
|
70
|
+
"name": "Task No Default",
|
|
71
|
+
"project_id": self.project_without_default.id,
|
|
72
|
+
"stage_id": self.stage_without_default.id,
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
self.assertFalse(set(task.user_ids.ids) & {self.user1.id, self.user2.id})
|
|
76
|
+
|
|
77
|
+
def test_stage_change_with_default(self):
|
|
78
|
+
task = self.env["project.task"].create(
|
|
79
|
+
{
|
|
80
|
+
"name": "Task Change Stage",
|
|
81
|
+
"project_id": self.project_with_default.id,
|
|
82
|
+
"stage_id": self.stage_without_default.id,
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
task.stage_id = self.stage_with_default
|
|
86
|
+
self.assertEqual(task.user_ids.ids, [self.user2.id])
|
|
87
|
+
|
|
88
|
+
def test_stage_change_no_default(self):
|
|
89
|
+
task = self.env["project.task"].create(
|
|
90
|
+
{
|
|
91
|
+
"name": "Task Change Stage",
|
|
92
|
+
"project_id": self.project_with_default.id,
|
|
93
|
+
"stage_id": self.stage_with_default.id,
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
task.stage_id = self.stage_without_default
|
|
97
|
+
self.assertEqual(task.user_ids.ids, [self.user1.id])
|
|
98
|
+
|
|
99
|
+
def test_stage_merge_with_existing_user(self):
|
|
100
|
+
self.stage_with_default.write(
|
|
101
|
+
{
|
|
102
|
+
"stage_task_assignment_mode": "merge",
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
task = self.env["project.task"].create(
|
|
106
|
+
{
|
|
107
|
+
"name": "Merge With Existing",
|
|
108
|
+
"user_ids": [(6, 0, [self.user1.id])],
|
|
109
|
+
"project_id": self.project_without_default.id,
|
|
110
|
+
"stage_id": self.stage_with_default.id,
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
self.assertEqual(set(task.user_ids.ids), {self.user1.id, self.user2.id})
|
|
114
|
+
|
|
115
|
+
def test_stage_merge_without_existing_user(self):
|
|
116
|
+
self.stage_with_default.write(
|
|
117
|
+
{
|
|
118
|
+
"stage_task_assignment_mode": "merge",
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
task = self.env["project.task"].create(
|
|
122
|
+
{
|
|
123
|
+
"name": "Empty Merge",
|
|
124
|
+
"user_ids": False,
|
|
125
|
+
"project_id": self.project_without_default.id,
|
|
126
|
+
"stage_id": self.stage_with_default.id,
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
self.assertEqual(set(task.user_ids.ids), {self.user2.id})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
|
+
<odoo>
|
|
3
|
+
<!--
|
|
4
|
+
Copyright 2025 NICO SOLUTIONS - ENGINEERING & IT
|
|
5
|
+
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
|
6
|
+
-->
|
|
7
|
+
<record id="project_edit_project_inherit_default_user" model="ir.ui.view">
|
|
8
|
+
<field name="name">project.edit.project.inherit.default.user</field>
|
|
9
|
+
<field name="model">project.project</field>
|
|
10
|
+
<field name="inherit_id" ref="project.edit_project" />
|
|
11
|
+
<field name="arch" type="xml">
|
|
12
|
+
<xpath expr="//page[@name='settings']" position="after">
|
|
13
|
+
<page name="default_users" string="Default users">
|
|
14
|
+
<group>
|
|
15
|
+
<group>
|
|
16
|
+
<field name="default_user_ids" widget="many2many_tags" />
|
|
17
|
+
<field name="project_task_assignment_mode" />
|
|
18
|
+
</group>
|
|
19
|
+
</group>
|
|
20
|
+
</page>
|
|
21
|
+
</xpath>
|
|
22
|
+
</field>
|
|
23
|
+
</record>
|
|
24
|
+
</odoo>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
|
+
<odoo>
|
|
3
|
+
<!--
|
|
4
|
+
Copyright 2025 NICO SOLUTIONS - ENGINEERING & IT
|
|
5
|
+
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
|
6
|
+
-->
|
|
7
|
+
<record id="project_task_type_tree_inherit_default_user" model="ir.ui.view">
|
|
8
|
+
<field name="name">project.task.type.tree.inherit.default.user</field>
|
|
9
|
+
<field name="model">project.task.type</field>
|
|
10
|
+
<field name="inherit_id" ref="project.task_type_tree" />
|
|
11
|
+
<field name="arch" type="xml">
|
|
12
|
+
<xpath expr="//field[@name='name']" position="after">
|
|
13
|
+
<field name="default_user_ids" widget="many2many_tags" />
|
|
14
|
+
<field name="stage_task_assignment_mode" />
|
|
15
|
+
</xpath>
|
|
16
|
+
</field>
|
|
17
|
+
</record>
|
|
18
|
+
<record id="project_task_type_edit_inherit_default_user" model="ir.ui.view">
|
|
19
|
+
<field name="name">project.task.type.edit.inherit.default.user</field>
|
|
20
|
+
<field name="model">project.task.type</field>
|
|
21
|
+
<field name="inherit_id" ref="project.task_type_edit" />
|
|
22
|
+
<field name="arch" type="xml">
|
|
23
|
+
<xpath expr="//field[@name='sequence']" position="after">
|
|
24
|
+
<field name="default_user_ids" widget="many2many_tags" />
|
|
25
|
+
<field name="stage_task_assignment_mode" />
|
|
26
|
+
</xpath>
|
|
27
|
+
</field>
|
|
28
|
+
</record>
|
|
29
|
+
</odoo>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: odoo-addon-project_task_default_user
|
|
3
|
+
Version: 18.0.1.0.0.2
|
|
4
|
+
Requires-Python: >=3.10
|
|
5
|
+
Requires-Dist: odoo==18.0.*
|
|
6
|
+
Summary: Auto assign default users to tasks or when changing task stages
|
|
7
|
+
Home-page: https://github.com/OCA/project
|
|
8
|
+
License: AGPL-3
|
|
9
|
+
Author: NICO SOLUTIONS - ENGINEERING & IT, Odoo Community Association (OCA)
|
|
10
|
+
Author-email: support@odoo-community.org
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
12
|
+
Classifier: Framework :: Odoo
|
|
13
|
+
Classifier: Framework :: Odoo :: 18.0
|
|
14
|
+
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
|
15
|
+
Description-Content-Type: text/x-rst
|
|
16
|
+
|
|
17
|
+
.. image:: https://odoo-community.org/readme-banner-image
|
|
18
|
+
:target: https://odoo-community.org/get-involved?utm_source=readme
|
|
19
|
+
:alt: Odoo Community Association
|
|
20
|
+
|
|
21
|
+
=========================
|
|
22
|
+
Project Task Default User
|
|
23
|
+
=========================
|
|
24
|
+
|
|
25
|
+
..
|
|
26
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
27
|
+
!! This file is generated by oca-gen-addon-readme !!
|
|
28
|
+
!! changes will be overwritten. !!
|
|
29
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
30
|
+
!! source digest: sha256:2b00bf26a2b4a420fcca734cb4c09820c5f24d00842a28575c17437c96897c4d
|
|
31
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
32
|
+
|
|
33
|
+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
34
|
+
:target: https://odoo-community.org/page/development-status
|
|
35
|
+
:alt: Beta
|
|
36
|
+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
|
|
37
|
+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
|
38
|
+
:alt: License: AGPL-3
|
|
39
|
+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github
|
|
40
|
+
:target: https://github.com/OCA/project/tree/18.0/project_task_default_user
|
|
41
|
+
:alt: OCA/project
|
|
42
|
+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
43
|
+
:target: https://translation.odoo-community.org/projects/project-18-0/project-18-0-project_task_default_user
|
|
44
|
+
:alt: Translate me on Weblate
|
|
45
|
+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
|
46
|
+
:target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=18.0
|
|
47
|
+
:alt: Try me on Runboat
|
|
48
|
+
|
|
49
|
+
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
50
|
+
|
|
51
|
+
This module automatically assigns default users to tasks.
|
|
52
|
+
|
|
53
|
+
- Stage-based assignment (priority rule): When creating a task or
|
|
54
|
+
changing its stage to one with default users, those users are
|
|
55
|
+
automatically assigned according to the stage’s assignment mode
|
|
56
|
+
(replace or merge). Stage-based defaults always take priority over
|
|
57
|
+
project defaults.
|
|
58
|
+
- Project-based fallback: If the stage does not define any default
|
|
59
|
+
users, project default users are applied using the same assignment
|
|
60
|
+
mode logic (replace or merge).
|
|
61
|
+
- Assignment behavior: The assignment mode controls how users are
|
|
62
|
+
applied:
|
|
63
|
+
|
|
64
|
+
- replace: replaces existing task users with default users
|
|
65
|
+
- merge: adds default users to the existing task users without
|
|
66
|
+
removing them
|
|
67
|
+
|
|
68
|
+
- Multiple default users supported: Both project and stage can define
|
|
69
|
+
multiple default users.
|
|
70
|
+
|
|
71
|
+
**Table of contents**
|
|
72
|
+
|
|
73
|
+
.. contents::
|
|
74
|
+
:local:
|
|
75
|
+
|
|
76
|
+
Configuration
|
|
77
|
+
=============
|
|
78
|
+
|
|
79
|
+
To use this module, you need to:
|
|
80
|
+
|
|
81
|
+
1. Open Project settings and set default users in the "Default Users"
|
|
82
|
+
tab and configure the assignment mode.
|
|
83
|
+
2. Activate developer mode.
|
|
84
|
+
3. Go to Project → Configuration → Task Stages, set default users in the
|
|
85
|
+
"Default Users for this Stage" field and configure the assignment
|
|
86
|
+
mode.
|
|
87
|
+
|
|
88
|
+
Bug Tracker
|
|
89
|
+
===========
|
|
90
|
+
|
|
91
|
+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/project/issues>`_.
|
|
92
|
+
In case of trouble, please check there if your issue has already been reported.
|
|
93
|
+
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
94
|
+
`feedback <https://github.com/OCA/project/issues/new?body=module:%20project_task_default_user%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
95
|
+
|
|
96
|
+
Do not contact contributors directly about support or help with technical issues.
|
|
97
|
+
|
|
98
|
+
Credits
|
|
99
|
+
=======
|
|
100
|
+
|
|
101
|
+
Authors
|
|
102
|
+
-------
|
|
103
|
+
|
|
104
|
+
* NICO SOLUTIONS - ENGINEERING & IT
|
|
105
|
+
|
|
106
|
+
Contributors
|
|
107
|
+
------------
|
|
108
|
+
|
|
109
|
+
- `NICO SOLUTIONS - ENGINEERING & IT <https://www.nico-solutions.de>`__:
|
|
110
|
+
|
|
111
|
+
- Nils Coenen <nils.coenen@nico-solutions.de>
|
|
112
|
+
|
|
113
|
+
Maintainers
|
|
114
|
+
-----------
|
|
115
|
+
|
|
116
|
+
This module is maintained by the OCA.
|
|
117
|
+
|
|
118
|
+
.. image:: https://odoo-community.org/logo.png
|
|
119
|
+
:alt: Odoo Community Association
|
|
120
|
+
:target: https://odoo-community.org
|
|
121
|
+
|
|
122
|
+
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
123
|
+
mission is to support the collaborative development of Odoo features and
|
|
124
|
+
promote its widespread use.
|
|
125
|
+
|
|
126
|
+
.. |maintainer-NICO-SOLUTIONS| image:: https://github.com/NICO-SOLUTIONS.png?size=40px
|
|
127
|
+
:target: https://github.com/NICO-SOLUTIONS
|
|
128
|
+
:alt: NICO-SOLUTIONS
|
|
129
|
+
|
|
130
|
+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
|
131
|
+
|
|
132
|
+
|maintainer-NICO-SOLUTIONS|
|
|
133
|
+
|
|
134
|
+
This module is part of the `OCA/project <https://github.com/OCA/project/tree/18.0/project_task_default_user>`_ project on GitHub.
|
|
135
|
+
|
|
136
|
+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
odoo/addons/project_task_default_user/README.rst,sha256=ztQCAkxtK7vWCjzJjeTjbvwPqB3qNHR-BQQi-RIlOHw,4500
|
|
2
|
+
odoo/addons/project_task_default_user/__init__.py,sha256=X9EJGOE2GtZbS0G82PtSXmWSZ_R8jEM0rlJTDliQjp4,21
|
|
3
|
+
odoo/addons/project_task_default_user/__manifest__.py,sha256=oEPUhefe8oWm2f7CUujT3ruUouKQVnSbfwsPNBK8Xpk,713
|
|
4
|
+
odoo/addons/project_task_default_user/i18n/project_task_default_user.pot,sha256=gSUXpv5ezI8K3URftMErfR1pwbWaeXm7c6RFWX12zNg,3297
|
|
5
|
+
odoo/addons/project_task_default_user/models/__init__.py,sha256=NOsmAvcO_EdZpUxUQSUGRJJbVBR0uiSj_Nhr1oULAu0,155
|
|
6
|
+
odoo/addons/project_task_default_user/models/project_project.py,sha256=FBTj7qTg-KqKUT0OdSF398XhltW9eYKOv1dv7qba8YQ,1124
|
|
7
|
+
odoo/addons/project_task_default_user/models/project_task.py,sha256=nDXnS8nRYYqCDDTrI0ipbi_ngqMMqZZsdgD02C2JAh0,1750
|
|
8
|
+
odoo/addons/project_task_default_user/models/project_task_type.py,sha256=J8Did6e3y9EhzHF_I4C9yB-h7B1D95ZSmdUWD2U1EAk,1130
|
|
9
|
+
odoo/addons/project_task_default_user/readme/CONFIGURE.md,sha256=-gpw8MFfdzZ5n8zMnne0NLUGVNTeZ0D4ApoJ42E4eh4,320
|
|
10
|
+
odoo/addons/project_task_default_user/readme/CONTRIBUTORS.md,sha256=OOezwPZxjVIiUxaNuxZjEmLibuGQnPSLKv6lcxPPNNs,122
|
|
11
|
+
odoo/addons/project_task_default_user/readme/DESCRIPTION.md,sha256=_p5KsCnBpGw7zZXTscleyPIe0ttKwfLAEFIElaMi3gQ,811
|
|
12
|
+
odoo/addons/project_task_default_user/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
|
|
13
|
+
odoo/addons/project_task_default_user/static/description/index.html,sha256=Vl3r8EQBEy0OIS_wpV2UxuwpeZEAfWK-lJSGfizMlCc,14248
|
|
14
|
+
odoo/addons/project_task_default_user/tests/__init__.py,sha256=PcNxp9OSorTY-2hsEevMpWnMFFOCDFz88NyDkCv5Iy4,45
|
|
15
|
+
odoo/addons/project_task_default_user/tests/test_project_task_default_user.py,sha256=qnsF0l5d-bOwwjpz3ivDSELLjV5ihp-UTfapSfEQvn0,4473
|
|
16
|
+
odoo/addons/project_task_default_user/views/project_project_views.xml,sha256=BDRLk38lLqMQ_R3v39FqHdGcc1Ne5ufPmkmlc4f9tnw,1009
|
|
17
|
+
odoo/addons/project_task_default_user/views/project_task_type_views.xml,sha256=MAtmvOs3JOdVPfDMUrB8d47q-9TOHNdeKoWugehqWB4,1349
|
|
18
|
+
odoo_addon_project_task_default_user-18.0.1.0.0.2.dist-info/METADATA,sha256=SvxmKSqt7vz7LBW5aGXjtx6OWFCZ-sslqij8QCcHLWI,5112
|
|
19
|
+
odoo_addon_project_task_default_user-18.0.1.0.0.2.dist-info/WHEEL,sha256=ZhOvUsYhy81Dx67gN3TV0RchQWBIIzutDZaJODDg2Vo,81
|
|
20
|
+
odoo_addon_project_task_default_user-18.0.1.0.0.2.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
|
|
21
|
+
odoo_addon_project_task_default_user-18.0.1.0.0.2.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
odoo
|