@ -0,0 +1,55 @@ |
|||
.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg |
|||
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
|||
:alt: License: LGPL-3 |
|||
|
|||
User Activity Audit |
|||
==================== |
|||
Track user's all type of activities like create,write,read etc |
|||
|
|||
Features |
|||
======== |
|||
* Retrieve the Users Activities. |
|||
|
|||
Configuration |
|||
============= |
|||
Enable security group for the user under user audit section in user. |
|||
select either Manager or User |
|||
|
|||
License |
|||
------- |
|||
General Public License, Version 3 (LGPL v3). |
|||
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
Credits |
|||
------- |
|||
* Developers: (V16) Sreeshanth V S, |
|||
(V17) Farhana Jahan PT, |
|||
(V18) Manasa T P |
|||
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 `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -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 LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from . import models |
|||
from . import wizard |
@ -0,0 +1,56 @@ |
|||
# -*- 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 LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
{ |
|||
'name': "User Activity Audit", |
|||
"version": "18.0.1.0.0", |
|||
"category": "Extra Tools", |
|||
"summary": "Tracking user's create, write, read activities", |
|||
"description": "This module helps you to track user's all type of " |
|||
"activities like create, write, read etc on various models " |
|||
"and records in all users", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': "https://www.cybrosys.com", |
|||
'depends': ['web'], |
|||
'data': [ |
|||
'security/user_audit_groups.xml', |
|||
'security/ir.model.access.csv', |
|||
'security/user_audit_security.xml', |
|||
'data/user_audit_data.xml', |
|||
'views/user_audit_log_views.xml', |
|||
'views/user_audit_views.xml', |
|||
'wizard/clear_user_log_views.xml', |
|||
'views/user_audit_menus.xml' |
|||
], |
|||
'assets': |
|||
{ |
|||
'web.assets_backend': [ |
|||
'user_audit/static/src/js/list_controller.js', |
|||
'user_audit/static/src/js/form_controller.js' |
|||
]}, |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'LGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': True |
|||
} |
@ -0,0 +1,12 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<!-- User audit log sequence number --> |
|||
<record id="sequence_user_audit_log" model="ir.sequence"> |
|||
<field name="name">Sequence</field> |
|||
<field name="code">user.audit.log</field> |
|||
<field name="prefix">TA</field> |
|||
<field name="padding">2</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,5 @@ |
|||
## Module <user_audit> |
|||
#### 5.11.2024 |
|||
#### Version 18.0.1.0.0 |
|||
#### ADD |
|||
- Initial commit for User Activity Audit |
@ -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 LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from . import user_audit_log |
|||
from . import user_audit |
@ -0,0 +1,112 @@ |
|||
# -*- 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 LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class UserAudit(models.Model): |
|||
"""We can manage user audit configuration.We can add user |
|||
model etc. which are to track""" |
|||
_name = "user.audit" |
|||
_description = "User Audit Log Configuration" |
|||
|
|||
name = fields.Char(required=True, string="Name", help="Name of the log") |
|||
is_read = fields.Boolean(string="Read", |
|||
help="Enabling we can track all read activities " |
|||
"It will track all your read activity that " |
|||
"may increase the size of the log that may " |
|||
"cause some problem with your data base") |
|||
is_write = fields.Boolean(string="Write", |
|||
help="Enabling we can track all write " |
|||
"activities") |
|||
is_create = fields.Boolean(string="Create", |
|||
help="Enabling we can track all create " |
|||
"activities") |
|||
is_delete = fields.Boolean(string="Delete", |
|||
help="Enabling we can track all delete " |
|||
"activities") |
|||
is_all_users = fields.Boolean(string="All Users", |
|||
help="Enabling we can track activities of " |
|||
"all users") |
|||
user_ids = fields.Many2many('res.users', string="Users", |
|||
help="Manage users") |
|||
model_ids = fields.Many2many('ir.model', string="Model", |
|||
help='Used to select which model is to track') |
|||
|
|||
@api.model |
|||
def create_audit_log_for_create(self, res_model): |
|||
""" Used to create user audit log based on the create operation """ |
|||
model_id = self.env['ir.model'].sudo().search([('model', '=', res_model)]).id |
|||
audit = self.search([('model_ids', 'in', model_id)]) |
|||
if audit and audit.is_create: |
|||
self.env['user.audit.log'].create({ |
|||
'user_id': self.env.user.id, |
|||
'model_id': model_id, |
|||
'operation_type': 'create', |
|||
'date': fields.Datetime.now() |
|||
}) |
|||
return res_model |
|||
|
|||
@api.model |
|||
def create_audit_log_for_read(self, res_model, record_id): |
|||
""" Used to create user audit log based on the read operation """ |
|||
model_id = self.env['ir.model'].sudo().search([('model', '=', res_model)]).id |
|||
audit = self.search([('model_ids', 'in', model_id)]) |
|||
if audit and audit.is_read: |
|||
self.env['user.audit.log'].create({ |
|||
'user_id': self.env.user.id, |
|||
'model_id': model_id, |
|||
'record': record_id, |
|||
'operation_type': 'read', |
|||
'date': fields.Datetime.now() |
|||
}) |
|||
return res_model |
|||
|
|||
@api.model |
|||
def create_audit_log_for_delete(self, res_model, record_id): |
|||
""" Used to create user audit log based on the delete operation """ |
|||
model = self.env['ir.model'].sudo().search([('model', '=', res_model)]) |
|||
model_id = self.env[res_model].browse(record_id) |
|||
audit = self.search([('model_ids', 'in', model.id)]) |
|||
if audit and audit.is_delete and record_id and model_id: |
|||
self.env['user.audit.log'].create({ |
|||
'user_id': self.env.user.id, |
|||
'model_id': model.id, |
|||
'record': record_id, |
|||
'operation_type': 'delete', |
|||
'date': fields.Datetime.now() |
|||
}) |
|||
return res_model |
|||
|
|||
@api.model |
|||
def create_audit_log_for_write(self, res_model, record_id): |
|||
""" Used to create user audit log based on the write operation """ |
|||
model_id = self.env['ir.model'].sudo().search([('model', '=', res_model)]).id |
|||
audit = self.search([('model_ids', 'in', model_id)]) |
|||
if audit and audit.is_write: |
|||
self.env['user.audit.log'].create({ |
|||
'user_id': self.env.user.id, |
|||
'model_id': model_id, |
|||
'record': record_id, |
|||
'operation_type': 'write', |
|||
'date': fields.Datetime.now() |
|||
}) |
|||
return res_model |
@ -0,0 +1,56 @@ |
|||
# -*- 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 LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class UserAuditLogs(models.Model): |
|||
""" For tracking user activity by adding user logs """ |
|||
_name = "user.audit.log" |
|||
_description = "User Audit Details" |
|||
|
|||
name = fields.Char(string="Reference", required=True, readonly=True, |
|||
default='New', help="For getting reference") |
|||
user_id = fields.Many2one('res.users', string="User", |
|||
help="For getting user") |
|||
record = fields.Integer(string="Record ID", |
|||
help="For getting which record has accessed") |
|||
model_id = fields.Many2one('ir.model', string="Object", |
|||
help="For getting which model has accessed") |
|||
operation_type = fields.Selection(selection=[('read', 'Read'), |
|||
('write', 'Write'), |
|||
('create', 'Create'), |
|||
('delete', 'Delete')], |
|||
string="Type", |
|||
help="For getting which operation has " |
|||
"been performed") |
|||
date = fields.Datetime(string="Date", |
|||
help="For getting which time the operation has done") |
|||
|
|||
@api.model_create_multi |
|||
def create(self, values): |
|||
""" For adding sequence number """ |
|||
vals = values[0] |
|||
if vals.get('name', 'New'): |
|||
vals['name'] = self.env['ir.sequence'].next_by_code( |
|||
'user.audit.log') |
|||
res = super(UserAuditLogs, self).create(vals) |
|||
return res |
|
@ -0,0 +1,18 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- User groups for Agriculture Management--> |
|||
<record id="module_user_audit" model="ir.module.category"> |
|||
<field name="name">User Audit</field> |
|||
<field name="description">User Audit</field> |
|||
</record> |
|||
<record id="group_user_audit_user" model="res.groups"> |
|||
<field name="name">User</field> |
|||
<field name="category_id" ref="module_user_audit"/> |
|||
</record> |
|||
<record id="group_user_audit_admin" model="res.groups"> |
|||
<field name="name">Manager</field> |
|||
<field name="category_id" ref="module_user_audit"/> |
|||
<field name="implied_ids" eval="[(4, ref('group_user_audit_user'))]"/> |
|||
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,17 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data noupdate="1"> |
|||
<record id="user_audit_rule_group_user" model="ir.rule"> |
|||
<field name="name">User access</field> |
|||
<field name="model_id" ref="model_user_audit_log"/> |
|||
<field name="domain_force">[('user_id','=',user.id)]</field> |
|||
<field name="groups" eval="[Command.link(ref('user_audit.group_user_audit_user'))]"/> |
|||
</record> |
|||
<record id="user_audit_rule_group_admin" model="ir.rule"> |
|||
<field name="name">Admin full access</field> |
|||
<field name="model_id" ref="model_user_audit_log"/> |
|||
<field name="groups" eval="[Command.link(ref('user_audit.group_user_audit_admin'))]"/> |
|||
<field name="domain_force">[(1, '=', 1)]</field> |
|||
</record> |
|||
</data> |
|||
</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: 375 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: 767 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 760 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 697 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 100 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 151 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 101 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 93 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 704 KiB |
After Width: | Height: | Size: 40 KiB |