diff --git a/g2p_program_user_mapping/.gitignore b/g2p_program_user_mapping/.gitignore new file mode 100644 index 0000000..b6e4761 --- /dev/null +++ b/g2p_program_user_mapping/.gitignore @@ -0,0 +1,129 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ diff --git a/g2p_program_user_mapping/README.rst b/g2p_program_user_mapping/README.rst new file mode 100644 index 0000000..76f10fa --- /dev/null +++ b/g2p_program_user_mapping/README.rst @@ -0,0 +1,54 @@ +========================== +G2P Programs: User Mapping +========================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/github-OpenG2P%2Fopeng2p--program-lightgray.png?logo=github + :target: https://github.com/OpenG2P/openg2p-program/tree/15.0-develop/g2p_program_user_mapping + :alt: OpenG2P/openg2p-program + +|badge1| |badge2| + +G2P Program User Mapping + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* OpenG2P + +Maintainers +~~~~~~~~~~~ + +This module is part of the `OpenG2P/openg2p-program `_ project on GitHub. + +You are welcome to contribute. diff --git a/g2p_program_user_mapping/__init__.py b/g2p_program_user_mapping/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/g2p_program_user_mapping/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/g2p_program_user_mapping/__manifest__.py b/g2p_program_user_mapping/__manifest__.py new file mode 100644 index 0000000..472c562 --- /dev/null +++ b/g2p_program_user_mapping/__manifest__.py @@ -0,0 +1,26 @@ +{ + "name": "G2P Programs: User Mapping", + "category": "G2P", + "version": "15.0.1.1.0", + "sequence": 1, + "author": "OpenG2P", + "website": "https://github.com/openg2p/openg2p-program", + "license": "Other OSI approved licence", + "depends": ["g2p_programs"], + "development_status": "Alpha", + "data": [ + "security/record_rules.xml", + "security/ir.model.access.csv", + "views/program_user_mapping.xml", + "views/res_users.xml", + ], + "assets": { + "web.assets_backend": [], + "web.assets_qweb": [], + }, + "demo": [], + "images": [], + "application": True, + "installable": True, + "auto_install": False, +} diff --git a/g2p_program_user_mapping/models/__init__.py b/g2p_program_user_mapping/models/__init__.py new file mode 100644 index 0000000..89e5fa2 --- /dev/null +++ b/g2p_program_user_mapping/models/__init__.py @@ -0,0 +1 @@ +from . import program_user diff --git a/g2p_program_user_mapping/models/program_user.py b/g2p_program_user_mapping/models/program_user.py new file mode 100644 index 0000000..263d64f --- /dev/null +++ b/g2p_program_user_mapping/models/program_user.py @@ -0,0 +1,29 @@ +from odoo import fields, models + + +class ProgramUsers(models.Model): + _name = "g2p.program.user.mapping" + _description = "Program user mapping" + + program_id = fields.Many2one("g2p.program") + user_id = fields.Many2one("res.users") + + _sql_constraints = [ + ( + "program_user_unique", + "unique (program_id, user_id)", + "User must be unique per program.", + ), + ] + + +class ResUsers(models.Model): + _inherit = "res.users" + + assigned_program_mapping = fields.One2many("g2p.program.user.mapping", "user_id") + + +class G2PProgram(models.Model): + _inherit = "g2p.program" + + assigned_user_mapping = fields.One2many("g2p.program.user.mapping", "program_id") diff --git a/g2p_program_user_mapping/readme/DESCRIPTION.rst b/g2p_program_user_mapping/readme/DESCRIPTION.rst new file mode 100644 index 0000000..4f66aec --- /dev/null +++ b/g2p_program_user_mapping/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +G2P Program User Mapping diff --git a/g2p_program_user_mapping/readme/assign_programs_program_manager.md b/g2p_program_user_mapping/readme/assign_programs_program_manager.md new file mode 100644 index 0000000..8655e60 --- /dev/null +++ b/g2p_program_user_mapping/readme/assign_programs_program_manager.md @@ -0,0 +1,24 @@ +# Ability to assign number of programs to a program manager + +## Introduction- + +Admin can able to assign number of programs to a program manager.so that program manager can see those +programs which he was assigned. + +## Getting Started- + +- To get start, have to install g2p_program_user_mapping module +- Go to Programs--> select program --> open--> Go to tabs--> select program users --> Add a line --> select + user(program manager) --> click on save and close +- Now particular program assigned to particular user(program manager) + +## Feature: + +- This feature enables to restrict user to access the programs which assigned tho respective user only +- Admin can view all programs and assign programs to users +- program manager can view programs which alotted to him only + +## Conclusion + +Admin can able to assign number of programs to a program manager.so that program manager can see those +programs which he was assigned. diff --git a/g2p_program_user_mapping/security/ir.model.access.csv b/g2p_program_user_mapping/security/ir.model.access.csv new file mode 100644 index 0000000..c337f48 --- /dev/null +++ b/g2p_program_user_mapping/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +g2p_program_user_mapping_admin,Program User Mapping Admin Access,g2p_program_user_mapping.model_g2p_program_user_mapping,g2p_registry_base.group_g2p_admin,1,1,1,1 +g2p_program_user_mapping_program_manager,Program User Mapping program manager Access,g2p_program_user_mapping.model_g2p_program_user_mapping,g2p_programs.g2p_program_manager,1,0,1,0 +g2p_program_user_mapping_base_user,Program User Mapping base user Access,g2p_program_user_mapping.model_g2p_program_user_mapping,base.group_user,1,0,0,0 diff --git a/g2p_program_user_mapping/security/record_rules.xml b/g2p_program_user_mapping/security/record_rules.xml new file mode 100644 index 0000000..fc80147 --- /dev/null +++ b/g2p_program_user_mapping/security/record_rules.xml @@ -0,0 +1,55 @@ + + + + Program User Program Manager + + [('assigned_user_mapping.user_id.id', '=', user.id)] + + + + + + + + Program User Admin + + [] + + + + + + + + + + Program User Mapping Program Manager + + [('program_id.assigned_user_mapping.user_id.id', '=', user.id)] + + + + + + + + Program User Mapping Admin + + [] + + + + + + + + Program User Mapping Base User + + [] + + + + + + + diff --git a/g2p_program_user_mapping/static/description/icon.png b/g2p_program_user_mapping/static/description/icon.png new file mode 100644 index 0000000..4adeb27 Binary files /dev/null and b/g2p_program_user_mapping/static/description/icon.png differ diff --git a/g2p_program_user_mapping/static/description/index.html b/g2p_program_user_mapping/static/description/index.html new file mode 100644 index 0000000..f85a845 --- /dev/null +++ b/g2p_program_user_mapping/static/description/index.html @@ -0,0 +1,413 @@ + + + + + + +G2P Programs: User Mapping + + + +
+

G2P Programs: User Mapping

+ + +

Alpha OpenG2P/openg2p-program

+

G2P Program User Mapping

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • OpenG2P
  • +
+
+
+

Maintainers

+

This module is part of the OpenG2P/openg2p-program project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/g2p_program_user_mapping/views/program_user_mapping.xml b/g2p_program_user_mapping/views/program_user_mapping.xml new file mode 100644 index 0000000..2a8dc63 --- /dev/null +++ b/g2p_program_user_mapping/views/program_user_mapping.xml @@ -0,0 +1,32 @@ + + + + program.user.mapping.form + g2p.program + + + + + + + + + + +
+ + + + +
+
+
+
+
+
+
+
diff --git a/g2p_program_user_mapping/views/res_users.xml b/g2p_program_user_mapping/views/res_users.xml new file mode 100644 index 0000000..b05d03e --- /dev/null +++ b/g2p_program_user_mapping/views/res_users.xml @@ -0,0 +1,24 @@ + + + + res.users.program.mapping.form + res.users + + + + + + + + + + + + + + + + + + +