-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] new module project_customer_access
- Loading branch information
Clément Mombereau
committed
Dec 12, 2024
1 parent
a1c0eb3
commit a75c173
Showing
11 changed files
with
579 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
======================= | ||
Project Customer Access | ||
======================= | ||
|
||
Project menu and views for customers in your own ERP | ||
|
||
Purpose | ||
======= | ||
|
||
This module does this and that... | ||
|
||
Explain the use case. | ||
|
||
Configuration | ||
============= | ||
|
||
To configure this module, you need to: | ||
|
||
#. Go to ... | ||
|
||
Usage | ||
===== | ||
|
||
To use this module, you need to: | ||
|
||
#. Go to ... | ||
|
||
|
||
How to test | ||
=========== | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2024 Akretion | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Project Customer Access", | ||
"summary": """Project menu and views for customers in your own ERP""", | ||
"version": "16.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "Akretion", | ||
"website": "http://akretion.com", | ||
"depends": [ | ||
"project", | ||
# https://github.com/OCA/server-backend | ||
"base_group_backend", | ||
], | ||
"data": [ | ||
"data/res_groups.xml", | ||
"security/ir.model.access.csv", | ||
"views/project_task_views.xml", | ||
], | ||
"demo": [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<odoo> | ||
|
||
<record id="project_access_category" model="ir.module.category"> | ||
<field name="name">Project Access</field> | ||
<field name="sequence">90</field> | ||
</record> | ||
<record id="group_customer" model="res.groups"> | ||
<field name="name">Customer</field> | ||
<field name="category_id" ref="project_customer_access.project_access_category"/> | ||
<field name="implied_ids" eval="[(4, ref('base_group_backend.group_backend_ui_users'))]"/> | ||
</record> | ||
<record id="group_manager" model="res.groups"> | ||
<field name="name">Manager</field> | ||
<field name="category_id" ref="project_customer_access.project_access_category"/> | ||
<field name="implied_ids" eval="[(4, ref('project_customer_access.group_customer'))]"/> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import project_task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright 2024 Akretion | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import _, api, fields, models | ||
|
||
|
||
class ProjectTask(models.Model): | ||
_inherit = "project.task" | ||
|
||
technical_description = fields.Html() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_customer_project,access_customer_project,project.model_project_project,project_customer_access.group_customer,1,0,0,0 | ||
access_customer_task,access_customer_task,project.model_project_task,project_customer_access.group_customer,1,0,0,0 | ||
access_customer_task_type,access_customer_task_type,project.model_project_task_type,project_customer_access.group_customer,1,0,0,0 | ||
access_project_customer_manager,access_project_customer_manager,project.model_project_task,project_customer_access.group_manager,1,1,1,1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_project_customer_access |
29 changes: 29 additions & 0 deletions
29
project_customer_access/tests/test_project_customer_access.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright 2024 Akretion | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestProjectCustomerAccess(TransactionCase): | ||
|
||
def setUp(self): | ||
super().setUp() | ||
self.group_customer = self.env.ref("project_customer_access.group_customer") | ||
self.group_manager = self.env.ref("project_customer_access.group_manager") | ||
self.customer = self.env["res.users"].create( | ||
{ | ||
"name": "Customer", | ||
"login": "customer", | ||
"groups_id": [Command.set(self.group_customer.ids)], | ||
} | ||
) | ||
self.manager = self.env["res.users"].create( | ||
{ | ||
"name": "Manager", | ||
"login": "manager", | ||
"groups_id": [Command.set(self.group_manager.ids)], | ||
} | ||
) | ||
|
||
def test_1(self): | ||
pass |
Oops, something went wrong.