Skip to content

Commit 9dcefc8

Browse files
author
Clément Mombereau
committed
[ADD] new module project_customer_access
1 parent a1c0eb3 commit 9dcefc8

11 files changed

Lines changed: 417 additions & 0 deletions

File tree

project_customer_access/README.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
=======================
2+
Project Customer Access
3+
=======================
4+
5+
Project menu and views for customers in your own ERP
6+
7+
Purpose
8+
=======
9+
10+
This module does this and that...
11+
12+
Explain the use case.
13+
14+
Configuration
15+
=============
16+
17+
To configure this module, you need to:
18+
19+
#. Go to ...
20+
21+
Usage
22+
=====
23+
24+
To use this module, you need to:
25+
26+
#. Go to ...
27+
28+
29+
How to test
30+
===========
31+
32+
...
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2024 Akretion
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Project Customer Access",
6+
"summary": """Project menu and views for customers in your own ERP""",
7+
"version": "16.0.1.0.0",
8+
"license": "AGPL-3",
9+
"author": "Akretion",
10+
"website": "http://akretion.com",
11+
"depends": [
12+
"project",
13+
# https://github.com/OCA/server-backend
14+
"base_group_backend",
15+
],
16+
"data": [
17+
"data/res_groups.xml",
18+
"security/ir.model.access.csv",
19+
"views/project_task_views.xml",
20+
],
21+
"demo": [],
22+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<odoo>
2+
3+
<record id="project_access_category" model="ir.module.category">
4+
<field name="name">Project Access</field>
5+
<field name="sequence">90</field>
6+
</record>
7+
<record id="group_customer" model="res.groups">
8+
<field name="name">Customer</field>
9+
<field name="category_id" ref="project_customer_access.project_access_category"/>
10+
<field name="implied_ids" eval="[(4, ref('base_group_backend.group_backend_ui_users'))]"/>
11+
</record>
12+
<record id="group_manager" model="res.groups">
13+
<field name="name">Manager</field>
14+
<field name="category_id" ref="project_customer_access.project_access_category"/>
15+
<field name="implied_ids" eval="[(4, ref('project_customer_access.group_customer'))]"/>
16+
</record>
17+
18+
</odoo>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import project_task
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright 2024 Akretion
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import _, api, fields, models
5+
6+
7+
class ProjectTask(models.Model):
8+
_inherit = "project.task"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2+
access_customer_project,access_customer_project,project.model_project_project,project_customer_access.group_customer,1,0,0,0
3+
access_customer_task,access_customer_task,project.model_project_task,project_customer_access.group_customer,1,0,0,0
4+
access_customer_task_type,access_customer_task_type,project.model_project_task_type,project_customer_access.group_customer,1,0,0,0
5+
access_project_customer_manager,access_project_customer_manager,project.model_project_task,project_customer_access.group_manager,1,1,1,1
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import test_project_customer_access
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2024 Akretion
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo.tests.common import TransactionCase
5+
6+
7+
class TestProjectCustomerAccess(TransactionCase):
8+
9+
def setUp(self):
10+
super().setUp()
11+
self.group_customer = self.env.ref("project_customer_access.group_customer")
12+
self.group_manager = self.env.ref("project_customer_access.group_manager")
13+
self.customer = self.env["res.users"].create(
14+
{
15+
"name": "Customer",
16+
"login": "customer",
17+
"groups_id": [Command.set(self.group_customer.ids)],
18+
}
19+
)
20+
self.manager = self.env["res.users"].create(
21+
{
22+
"name": "Manager",
23+
"login": "manager",
24+
"groups_id": [Command.set(self.group_manager.ids)],
25+
}
26+
)
27+
28+
def test_1(self):
29+
pass

0 commit comments

Comments
 (0)