Skip to content

Commit

Permalink
[ADD] new module project_customer_access
Browse files Browse the repository at this point in the history
  • Loading branch information
Clément Mombereau committed Dec 12, 2024
1 parent a1c0eb3 commit a75c173
Show file tree
Hide file tree
Showing 11 changed files with 579 additions and 0 deletions.
32 changes: 32 additions & 0 deletions project_customer_access/README.rst
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
===========

...
1 change: 1 addition & 0 deletions project_customer_access/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
22 changes: 22 additions & 0 deletions project_customer_access/__manifest__.py
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": [],
}
18 changes: 18 additions & 0 deletions project_customer_access/data/res_groups.xml
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>
1 change: 1 addition & 0 deletions project_customer_access/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import project_task
10 changes: 10 additions & 0 deletions project_customer_access/models/project_task.py
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()
5 changes: 5 additions & 0 deletions project_customer_access/security/ir.model.access.csv
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
1 change: 1 addition & 0 deletions project_customer_access/static/description/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions project_customer_access/tests/__init__.py
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 project_customer_access/tests/test_project_customer_access.py
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
Loading

0 comments on commit a75c173

Please sign in to comment.