@ -0,0 +1,51 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
||||
|
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
Users Restriction For Project And Task |
||||
|
====================================== |
||||
|
This module is designed to specify and control which individuals or roles within an organization have permission to view or interact with project and task records. |
||||
|
|
||||
|
configuration |
||||
|
============= |
||||
|
Nothing to configure. |
||||
|
|
||||
|
License |
||||
|
======= |
||||
|
GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) |
||||
|
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developers: (V15) Nandakishore M , |
||||
|
(V17) Aysha Shalin, |
||||
|
(V18) Nivedhya T |
||||
|
Contact: odoo@cybrosys.com |
||||
|
|
||||
|
Contacts |
||||
|
-------- |
||||
|
* Mail Contact : odoo@cybrosys.com |
||||
|
* Website : https://cybrosys.com |
||||
|
|
||||
|
Bug Tracker |
||||
|
----------- |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
||||
|
|
||||
|
Maintainer |
||||
|
========== |
||||
|
.. image:: https://cybrosys.com/images/logo.png |
||||
|
:target: https://cybrosys.com |
||||
|
|
||||
|
This module is maintained by Cybrosys Technologies. |
||||
|
|
||||
|
For support and more information, please visit https://www.cybrosys.com |
||||
|
|
||||
|
image:: https://cybrosys.com/images/logo.png |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import models |
@ -0,0 +1,49 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
"name": "Users Restriction For Project And Task", |
||||
|
"version": "18.0.1.0.0", |
||||
|
"category": "Project", |
||||
|
"summary": "Users Restriction For Project And Task restricts and access " |
||||
|
"the users to the project and task records.", |
||||
|
"description": """The 'Users Restriction For Project And Task' is a system |
||||
|
designed to specify and control which individuals or roles within an |
||||
|
organization have permission to view or interact with project and task |
||||
|
records. It ensures that only authorized users can access and manage |
||||
|
sensitive project and task-related information, enhancing security and |
||||
|
privacy within the organization's data management processes""", |
||||
|
"author": "Cybrosys Techno Solutions", |
||||
|
"company": "Cybrosys Techno Solutions", |
||||
|
"maintainer": "Cybrosys Techno Solutions", |
||||
|
"website": "https://www.cybrosys.com", |
||||
|
"depends": ["project"], |
||||
|
"data": [ |
||||
|
"security/project_task_security.xml", |
||||
|
"views/project_project_views.xml", |
||||
|
"views/project_task_views.xml", |
||||
|
], |
||||
|
"images": ["static/description/banner.jpg"], |
||||
|
"license": "AGPL-3", |
||||
|
"installable": True, |
||||
|
"auto_install": False, |
||||
|
"application": False, |
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
## Module <project_task_access> |
||||
|
|
||||
|
#### 09.10.2024 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
##### ADD |
||||
|
- Initial commit for Users Restriction For Project And Task |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import project_project |
||||
|
from . import project_task |
@ -0,0 +1,45 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ProjectProject(models.Model): |
||||
|
""" To customise the access for the project and tasks """ |
||||
|
_inherit = "project.project" |
||||
|
|
||||
|
project_access_user_ids = fields.Many2many('res.users', |
||||
|
string='Access Limited Users', |
||||
|
help="The users who has " |
||||
|
"access for this record") |
||||
|
user_admin_check = fields.Boolean(string='sale_line_id_check', |
||||
|
compute='_compute_user_admin_check', |
||||
|
help="To check if the user is an Internal" |
||||
|
" user or not") |
||||
|
|
||||
|
def _compute_user_admin_check(self): |
||||
|
""" Determines if the current user is an admin to allow the |
||||
|
'task_access_user_ids' field to be editable only by 'user_admin'.""" |
||||
|
for rec in self: |
||||
|
if rec.env.user.id == rec.env.ref('base.user_admin').id: |
||||
|
rec.user_admin_check = True |
||||
|
else: |
||||
|
rec.user_admin_check = False |
@ -0,0 +1,47 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ProjectTask(models.Model): |
||||
|
""" The Class ProjectTask for the model project_task which is to |
||||
|
customise the access for the records. """ |
||||
|
_inherit = 'project.task' |
||||
|
|
||||
|
task_access_user_ids = fields.Many2many('res.users', |
||||
|
string='Access Limited Users', |
||||
|
help="The users who has access " |
||||
|
"for this record") |
||||
|
user_admin_check = fields.Boolean(string='sale_line_id_check', |
||||
|
compute='_compute_user_admin_check', |
||||
|
help="The Compute field to check if " |
||||
|
"the user is an Internal user or not") |
||||
|
|
||||
|
def _compute_user_admin_check(self): |
||||
|
"""The function computes a boolean field to check if the current |
||||
|
user is the admin for the purpose of making the |
||||
|
'task_access_user_ids' field editable only for 'user_admin'""" |
||||
|
for rec in self: |
||||
|
if rec.env.user.id == rec.env.ref('base.user_admin').id: |
||||
|
rec.user_admin_check = True |
||||
|
else: |
||||
|
rec.user_admin_check = False |
@ -0,0 +1,82 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- User security group "View Limited Projects and Tasks" --> |
||||
|
<record id="group_view_limited_projects_and_tasks" model="res.groups"> |
||||
|
<field name="name">View Limited Projects and Tasks</field> |
||||
|
<field name="category_id" ref="base.module_category_usability"/> |
||||
|
</record> |
||||
|
<!-- Record rule "Project Task Visible Users" --> |
||||
|
<record id="project_task_rule_user" model="ir.rule"> |
||||
|
<field name="name">Project Task Visible Users</field> |
||||
|
<field name="model_id" ref="model_project_task"/> |
||||
|
<field name="domain_force">['|', ('task_access_user_ids', 'in', user.id), ('task_access_user_ids', '=', False)]</field> |
||||
|
<field name="groups" eval="[(4, ref('group_view_limited_projects_and_tasks'))]"/> |
||||
|
<field name="perm_read" eval="True"/> |
||||
|
<field name="perm_write" eval="True"/> |
||||
|
<field name="perm_create" eval="True"/> |
||||
|
<field name="perm_unlink" eval="True"/> |
||||
|
<field name="active" eval="True"/> |
||||
|
</record> |
||||
|
<!-- Record rule "Project Visible Users" --> |
||||
|
<record id="project_project_rule_user" model="ir.rule"> |
||||
|
<field name="name">Project Project Visible Users</field> |
||||
|
<field name="model_id" ref="model_project_project"/> |
||||
|
<field name="domain_force">['|', ('project_access_user_ids', 'in', user.id), ('project_access_user_ids', '=', False)]</field> |
||||
|
<field name="groups" eval="[(4, ref('group_view_limited_projects_and_tasks'))]"/> |
||||
|
<field name="perm_read" eval="True"/> |
||||
|
<field name="perm_write" eval="True"/> |
||||
|
<field name="perm_create" eval="True"/> |
||||
|
<field name="perm_unlink" eval="True"/> |
||||
|
<field name="active" eval="True"/> |
||||
|
</record> |
||||
|
<!-- Changing "noupdate': False" to update the records --> |
||||
|
<function name="write" model="ir.model.data"> |
||||
|
<function name="search" model="ir.model.data"> |
||||
|
<value eval="[('module', '=', 'project'), ('name', '=', 'task_visibility_rule')]"/> |
||||
|
</function> |
||||
|
<value eval="{'noupdate': False}"/> |
||||
|
</function> |
||||
|
<function name="write" model="ir.model.data"> |
||||
|
<function name="search" model="ir.model.data"> |
||||
|
<value eval="[('module', '=', 'project'), ('name', '=', 'project_manager_all_project_tasks_rule')]"/> |
||||
|
</function> |
||||
|
<value eval="{'noupdate': False}"/> |
||||
|
</function> |
||||
|
<function name="write" model="ir.model.data"> |
||||
|
<function name="search" model="ir.model.data"> |
||||
|
<value eval="[('module', '=', 'project'), ('name', '=', 'ir_rule_private_task')]"/> |
||||
|
</function> |
||||
|
<value eval="{'noupdate': False}"/> |
||||
|
</function> |
||||
|
<function name="write" model="ir.model.data"> |
||||
|
<function name="search" model="ir.model.data"> |
||||
|
<value eval="[('module', '=', 'project'), ('name', '=', 'project_public_members_rule')]"/> |
||||
|
</function> |
||||
|
<value eval="{'noupdate': False}"/> |
||||
|
</function> |
||||
|
<!-- Updating the already existing records rules which create contradiction for this module's record rules --> |
||||
|
<record model="ir.rule" id="project.task_visibility_rule"> |
||||
|
<field name="name">Project/Task: employees: follow required for follower-only projects</field> |
||||
|
<field name="model_id" ref="project.model_project_task"/> |
||||
|
<field name="domain_force">[]</field> |
||||
|
<field name="groups" eval="None"/> |
||||
|
</record> |
||||
|
<record model="ir.rule" id="project.project_manager_all_project_tasks_rule"> |
||||
|
<field name="name">Project/Task: project manager: see all</field> |
||||
|
<field name="model_id" ref="project.model_project_task"/> |
||||
|
<field name="domain_force">[(1, '=', 1)]</field> |
||||
|
<field name="groups" eval="[(4,ref('project.group_project_manager'))]"/> |
||||
|
</record> |
||||
|
<record id="project.ir_rule_private_task" model="ir.rule"> |
||||
|
<field name="name">Project: See private tasks</field> |
||||
|
<field name="model_id" ref="project.model_project_task"/> |
||||
|
<field name="domain_force">[]</field> |
||||
|
<field name="groups" eval="None"/> |
||||
|
</record> |
||||
|
<record model="ir.rule" id="project.project_public_members_rule"> |
||||
|
<field name="name">Project: employees: following required for follower-only projects</field> |
||||
|
<field name="model_id" ref="project.model_project_project"/> |
||||
|
<field name="domain_force">[]</field> |
||||
|
<field name="groups" eval="None"/> |
||||
|
</record> |
||||
|
</odoo> |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 103 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 112 KiB |
After Width: | Height: | Size: 100 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 116 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,16 @@ |
|||||
|
<?xml version="1.0"?> |
||||
|
<odoo> |
||||
|
<!-- Inherited Project form to add the custom field view for restricting the users --> |
||||
|
<record id="edit_project" model="ir.ui.view"> |
||||
|
<field name="name">project.project.view.form.inherit.project.task.access</field> |
||||
|
<field name="model">project.project</field> |
||||
|
<field name="inherit_id" ref="project.edit_project"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//field[@name='privacy_visibility']" position="after"> |
||||
|
<field name="project_access_user_ids" widget="many2many_tags" |
||||
|
readonly="not user_admin_check"/> |
||||
|
<field name="user_admin_check" invisible="1"/> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
@ -0,0 +1,16 @@ |
|||||
|
<?xml version="1.0"?> |
||||
|
<odoo> |
||||
|
<!-- Inheriting Task form to add the custom field view for restricting users --> |
||||
|
<record id="view_task_form2" model="ir.ui.view"> |
||||
|
<field name="name">project.task.view.form.inherit.project.task.access</field> |
||||
|
<field name="model">project.task</field> |
||||
|
<field name="inherit_id" ref="project.view_task_form2"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//field[@name='date_last_stage_update']" position="after"> |
||||
|
<field name="task_access_user_ids" widget="many2many_tags" |
||||
|
readonly="not user_admin_check"/> |
||||
|
<field name="user_admin_check" invisible="1"/> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |