diff --git a/export_delete_login_log/README.rst b/export_delete_login_log/README.rst new file mode 100644 index 000000000..c547d0c77 --- /dev/null +++ b/export_delete_login_log/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Export Delete Login Log +==================== +This module helps in logging information related to export of records, deleting of records and login details. + +Configuration +============= +- www.odoo.com/documentation/16.0/setup/install.html +- Install our custom addon +- This module uses an external API "ipapi" to fetch details related to IP addresses, its free version fetches upto 1000 response per day. If more than 1000 response are required per day then an API Key need to be purchased. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (V16) Developer Amal Prasad, 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 +-------- +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com" + +Further information +----------------- +HTML Description: ``__ diff --git a/export_delete_login_log/__init__.py b/export_delete_login_log/__init__.py new file mode 100644 index 000000000..2ad5188e6 --- /dev/null +++ b/export_delete_login_log/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import models diff --git a/export_delete_login_log/__manifest__.py b/export_delete_login_log/__manifest__.py new file mode 100644 index 000000000..00c4328d3 --- /dev/null +++ b/export_delete_login_log/__manifest__.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +{ + 'name': "Export, Delete, Login Log", + 'version': "16.0.1.0.0", + 'category': 'Extra Tools', + 'summary': """Logs information about Export, Delete, Login""", + 'description': """ + This module helps in logging information related to export of records, + deleting of records and login details. + """, + 'author': "Cybrosys Techno Solutions", + 'company': "Cybrosys Techno Solutions", + 'maintainer': "Cybrosys Techno Solutions", + 'website': "https://cybrosys.com/", + 'depends': ['base','base_setup'], + 'data': [ + 'security/ir_module_category_data.xml', + 'security/ir.model.access.csv', + 'views/res_config_settings_views.xml', + 'views/export_log_views.xml', + 'views/delete_log_views.xml', + 'views/login_user_log_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'export_delete_login_log/static/src/js/export_data.js' + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': "AGPL-3", + 'installable': True, + 'auto_install': True, + 'application': False +} diff --git a/export_delete_login_log/doc/RELEASE_NOTES.md b/export_delete_login_log/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..29aa187da --- /dev/null +++ b/export_delete_login_log/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 28.01.2024 +#### Version 16.0.1.0.0 +##### ADD + +Initial commit for Export Delete Login Log diff --git a/export_delete_login_log/models/__init__.py b/export_delete_login_log/models/__init__.py new file mode 100644 index 000000000..fc089b7a1 --- /dev/null +++ b/export_delete_login_log/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import delete_log +from . import export_log +from . import login_user_log +from . import res_config_settings diff --git a/export_delete_login_log/models/delete_log.py b/export_delete_login_log/models/delete_log.py new file mode 100644 index 000000000..2da76d474 --- /dev/null +++ b/export_delete_login_log/models/delete_log.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import fields, models + + +class DeleteLog(models.Model): + """Model to log information about deleted records""" + _name = 'delete.log' + _description = 'Delete Log' + _rec_name = 'rec_name' + + rec_model = fields.Many2one('ir.model', string="Model", help="Model Name") + rec_id = fields.Char(string="Record ID", help="ID of the record") + rec_name = fields.Char(string="Record Name", help="Name of the record") + delete_date = fields.Datetime(string="Delete Date", + default=lambda self: fields.Datetime.now(), + help="Delete date of the record") + user_id = fields.Many2one("res.users", string="Deleted by", + default=lambda self: self.env.user, + help="User which this record is deleted by") + + +class BaseModel(models.AbstractModel): + """Overrides the default unlink method to create record in DeleteLog + model""" + _inherit = 'base' + + def unlink(self): + """Creates records inside delete.log model""" + for rec_ids in self._cr.split_for_in_conditions(self.ids): + records = self.browse(rec_ids) + tracked_models = self.env['ir.config_parameter'].sudo().get_param( + 'export_delete_login_log.delete_log_models_ids') + if tracked_models: + if type(records)._name in [self.env['ir.model'].sudo().search( + [('id', '=', rec)] + ).model for rec in eval(tracked_models)]: + self.env['delete.log'].sudo().create({ + "rec_model": self.env['ir.model'].sudo().search( + [('model', '=', records._name)]).id, + "rec_id": records.id, + "rec_name": records.name_get()[0][1], + }) + return super().unlink() diff --git a/export_delete_login_log/models/export_log.py b/export_delete_login_log/models/export_log.py new file mode 100644 index 000000000..233d97556 --- /dev/null +++ b/export_delete_login_log/models/export_log.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import fields, models + + +class ExportLog(models.Model): + """Model to log information about exported records""" + _name = 'export.log' + _description = "Export Log" + _rec_name = 'rec_name' + + rec_model = fields.Many2one('ir.model', string="Model", + help="Name of the model") + rec_id = fields.Char(string="Record ID", help="ID of the record") + rec_name = fields.Char(string="Record Name", help="Name of the record") + export_date = fields.Datetime(string="Export Date", + default=lambda self: fields.Datetime.now(), + help="Export date of the record") + exported_fields_ids = fields.Many2many('ir.model.fields', + string="Exported Fields", + help="Fields that are exported") + export_user_id = fields.Many2one("res.users", string="Exported by", + default=lambda self: self.env.user, + help="User which the record is exported") + + def action_create_export_log(self, vals): + """ + To create export logs + """ + for rec in vals['records']: + rec_model_id = self.env['ir.model'].sudo().search( + [('model', '=', rec['rec_model'])] + ).id + self.sudo().create({ + "rec_model": rec_model_id, + "rec_id": rec['rec_id'], + "rec_name": self.env[rec['rec_model']].sudo().search( + [('id', '=', rec['rec_id'])] + ).name_get()[0][1], + "exported_fields_ids": [ + fields.Command.link( + self.env['ir.model.fields'].sudo().search([ + ('model_id', '=', rec_model_id), + ('name', '=', i['field_name']) + ]).id + ) + for i in vals['exportList'] + ], + }) diff --git a/export_delete_login_log/models/login_user_log.py b/export_delete_login_log/models/login_user_log.py new file mode 100644 index 000000000..3a320eeb3 --- /dev/null +++ b/export_delete_login_log/models/login_user_log.py @@ -0,0 +1,111 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +import requests +from itertools import chain +from odoo import api, fields, models + +USER_PRIVATE_FIELDS = ['password'] +concat = chain.from_iterable + + +class ResUsers(models.Model): + """Inherits ResUsers to create records inside LoginLog""" + _inherit = 'res.users' + + @api.model + def _check_credentials(self, password, user_agent_env): + """Supering the function and _check_credentials to create record + inside LoginLog""" + result = super()._check_credentials(password, user_agent_env) + have_api_key = self.env['ir.config_parameter'].sudo().get_param( + 'export_delete_login_log.have_api_key') + api_key = self.env['ir.config_parameter'].sudo().get_param( + 'export_delete_login_log.ipapi_key') + ip_address = (requests.get( + f'https://api.ipify.org?format=json').json()).get('ip') + response = requests.get( + f"https://ipapi.co/{ip_address}/json/?key={api_key}").json()\ + if have_api_key else requests.get( + f"https://ipapi.co/{ip_address}/json/").json() + if response.get("error"): + ip_data = { + "ip": ip_address, + } + else: + ip_data = { + "ip": ip_address, + "latitude": response.get("latitude"), + "longitude": response.get("longitude"), + "city": response.get("city"), + "region": response.get("region"), + "country": response.get("country_name"), + "postal": response.get("postal"), + "timezone": response.get("timezone"), + "error": response.get("error"), + "reason": response.get("reason"), + } + self.env['login.log'].sudo().create( + {'name': self.name, + 'ip_address': ip_address, + 'geo_loc': str(ip_data["latitude"]) + ", " + str( + ip_data["longitude"]), + 'address': str(ip_data["city"]) + ", " + str( + ip_data["region"]) + ", " + str(ip_data["country"]), + 'postal_code': ip_data["postal"], + 'time_zone': ip_data["timezone"], + 'remark': ("Free quota exceeded" + if ip_data["reason"] == "RateLimited" + else ip_data["reason"]) if ip_data["error"] else None + }) + return result + + +class LoginLog(models.Model): + """Model to log information about user login""" + _name = 'login.log' + _description = 'Login Log' + + name = fields.Char(string="User Name", readonly=True) + date_time = fields.Datetime(string="Login Date And Time", + default=lambda self: fields.datetime.now(), + readonly=True) + ip_address = fields.Char(string="IP Address", readonly=True) + geo_loc = fields.Char(string="Latitude / Longitude", readonly=True, + help="Data is fetched using users IP address so the " + "it may not be 100% precise") + address = fields.Char(string="Address", readonly=True, + help="Data is fetched using users IP address so the " + "it may not be 100% precise") + postal_code = fields.Char(string="Postal Code", readonly=True, + help="Data is fetched using users IP address so " + "the it may not be 100% precise") + time_zone = fields.Char(string="Time Zone", readonly=True, + help="Data is fetched using users IP address so " + "the it may not be 100% precise") + remark = fields.Text(string="Remarks", + help="Remark is added when there is an error in the " + "IP Address or other values, Error Reason: " + "\n1) RateLimited: Free daily quota exceeded" + "\n2) Invalid IP Address: The IP address used " + "by the User is Invalid" + "\n3) Reserved IP Address: The IP address used " + "by the User is Reserved") diff --git a/export_delete_login_log/models/res_config_settings.py b/export_delete_login_log/models/res_config_settings.py new file mode 100644 index 000000000..4d844e07b --- /dev/null +++ b/export_delete_login_log/models/res_config_settings.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import fields, models, api, _ +from ast import literal_eval +from odoo.exceptions import UserError + + +class ResConfigSettings(models.TransientModel): + """Inherits ResConfigSettings to add fields to support DeleteLog, + LoginLog""" + _inherit = 'res.config.settings' + + delete_log_models_ids = fields.Many2many('ir.model', + string="Delete log models", + domain=[ + ('model', '!=', 'delete.log') + ]) + have_api_key = fields.Boolean(string='Have API Key', + config_parameter='export_delete_login_log' + '.have_api_key') + ipapi_key = fields.Char(string='API Key', + config_parameter='export_delete_login_log' + '.ipapi_key') + + def set_values(self): + """Set values to delete_log_models_ids Many2many field""" + res = super().set_values() + if self.env.user in self.env.ref( + 'export_delete_login_log.group_export_log_manager').users: + self.env['ir.config_parameter'].sudo().set_param( + 'export_delete_login_log.delete_log_models_ids', + self.delete_log_models_ids.ids) + return res + else: + raise UserError( + _("You don't have the permission to modify this record.")) + + @api.model + def get_values(self): + """Get values from delete_log_models_ids Many2many field""" + res = super().get_values() + with_user = self.env['ir.config_parameter'].sudo() + tracked_models = with_user.get_param( + 'export_delete_login_log.delete_log_models_ids') + res.update(delete_log_models_ids=[(6, 0, literal_eval(tracked_models)) + ] if tracked_models else False, ) + return res diff --git a/export_delete_login_log/security/ir.model.access.csv b/export_delete_login_log/security/ir.model.access.csv new file mode 100755 index 000000000..34b4e4d08 --- /dev/null +++ b/export_delete_login_log/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 +access_group_delete_log_manager,access.group.delete.log.manager,model_delete_log,group_delete_log_manager,1,0,0,0 +access_group_login_log_manager,access.group.login.log.manager,model_login_log,group_login_log_manager,1,0,0,0 +access_group_export_log_manager,access.group.export.log.manager,model_export_log,group_export_log_manager,1,0,0,0 diff --git a/export_delete_login_log/security/ir_module_category_data.xml b/export_delete_login_log/security/ir_module_category_data.xml new file mode 100644 index 000000000..62ace10aa --- /dev/null +++ b/export_delete_login_log/security/ir_module_category_data.xml @@ -0,0 +1,43 @@ + + + + + Export Log + Helps you to give permissions to users for viewing Export Log based on given permission + 102 + + + + Delete Log + Helps you to give permissions to users for viewing Delete Log based on given permission + 93 + + + + Login Log + Helps you to give permissions to users for viewing Login Log based on given permission + 93 + + + + + Administrator + + + + + + Administrator + + + + + + Administrator + + + + diff --git a/export_delete_login_log/static/description/assets/icons/check.png b/export_delete_login_log/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/check.png differ diff --git a/export_delete_login_log/static/description/assets/icons/chevron.png b/export_delete_login_log/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/chevron.png differ diff --git a/export_delete_login_log/static/description/assets/icons/cogs.png b/export_delete_login_log/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/cogs.png differ diff --git a/export_delete_login_log/static/description/assets/icons/consultation.png b/export_delete_login_log/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/consultation.png differ diff --git a/export_delete_login_log/static/description/assets/icons/ecom-black.png b/export_delete_login_log/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/ecom-black.png differ diff --git a/export_delete_login_log/static/description/assets/icons/education-black.png b/export_delete_login_log/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/education-black.png differ diff --git a/export_delete_login_log/static/description/assets/icons/hotel-black.png b/export_delete_login_log/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/hotel-black.png differ diff --git a/export_delete_login_log/static/description/assets/icons/license.png b/export_delete_login_log/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/license.png differ diff --git a/export_delete_login_log/static/description/assets/icons/lifebuoy.png b/export_delete_login_log/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/lifebuoy.png differ diff --git a/export_delete_login_log/static/description/assets/icons/manufacturing-black.png b/export_delete_login_log/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/manufacturing-black.png differ diff --git a/export_delete_login_log/static/description/assets/icons/pos-black.png b/export_delete_login_log/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/pos-black.png differ diff --git a/export_delete_login_log/static/description/assets/icons/puzzle.png b/export_delete_login_log/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/puzzle.png differ diff --git a/export_delete_login_log/static/description/assets/icons/restaurant-black.png b/export_delete_login_log/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/restaurant-black.png differ diff --git a/export_delete_login_log/static/description/assets/icons/service-black.png b/export_delete_login_log/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/service-black.png differ diff --git a/export_delete_login_log/static/description/assets/icons/trading-black.png b/export_delete_login_log/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/trading-black.png differ diff --git a/export_delete_login_log/static/description/assets/icons/training.png b/export_delete_login_log/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/training.png differ diff --git a/export_delete_login_log/static/description/assets/icons/update.png b/export_delete_login_log/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/update.png differ diff --git a/export_delete_login_log/static/description/assets/icons/user.png b/export_delete_login_log/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/user.png differ diff --git a/export_delete_login_log/static/description/assets/icons/wrench.png b/export_delete_login_log/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/export_delete_login_log/static/description/assets/icons/wrench.png differ diff --git a/export_delete_login_log/static/description/assets/misc/categories.png b/export_delete_login_log/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/categories.png differ diff --git a/export_delete_login_log/static/description/assets/misc/check-box.png b/export_delete_login_log/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/check-box.png differ diff --git a/export_delete_login_log/static/description/assets/misc/compass.png b/export_delete_login_log/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/compass.png differ diff --git a/export_delete_login_log/static/description/assets/misc/corporate.png b/export_delete_login_log/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/corporate.png differ diff --git a/export_delete_login_log/static/description/assets/misc/customer-support.png b/export_delete_login_log/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/customer-support.png differ diff --git a/export_delete_login_log/static/description/assets/misc/cybrosys-logo.png b/export_delete_login_log/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/cybrosys-logo.png differ diff --git a/export_delete_login_log/static/description/assets/misc/features.png b/export_delete_login_log/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/features.png differ diff --git a/export_delete_login_log/static/description/assets/misc/logo.png b/export_delete_login_log/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/logo.png differ diff --git a/export_delete_login_log/static/description/assets/misc/pictures.png b/export_delete_login_log/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/pictures.png differ diff --git a/export_delete_login_log/static/description/assets/misc/pie-chart.png b/export_delete_login_log/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/pie-chart.png differ diff --git a/export_delete_login_log/static/description/assets/misc/right-arrow.png b/export_delete_login_log/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/right-arrow.png differ diff --git a/export_delete_login_log/static/description/assets/misc/star.png b/export_delete_login_log/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/star.png differ diff --git a/export_delete_login_log/static/description/assets/misc/support.png b/export_delete_login_log/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/support.png differ diff --git a/export_delete_login_log/static/description/assets/misc/whatsapp.png b/export_delete_login_log/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/export_delete_login_log/static/description/assets/misc/whatsapp.png differ diff --git a/export_delete_login_log/static/description/assets/modules/1.png b/export_delete_login_log/static/description/assets/modules/1.png new file mode 100644 index 000000000..b21837312 Binary files /dev/null and b/export_delete_login_log/static/description/assets/modules/1.png differ diff --git a/export_delete_login_log/static/description/assets/modules/2.png b/export_delete_login_log/static/description/assets/modules/2.png new file mode 100644 index 000000000..eb3f8652f Binary files /dev/null and b/export_delete_login_log/static/description/assets/modules/2.png differ diff --git a/export_delete_login_log/static/description/assets/modules/3.png b/export_delete_login_log/static/description/assets/modules/3.png new file mode 100644 index 000000000..a9c4ec82c Binary files /dev/null and b/export_delete_login_log/static/description/assets/modules/3.png differ diff --git a/export_delete_login_log/static/description/assets/modules/4.png b/export_delete_login_log/static/description/assets/modules/4.png new file mode 100644 index 000000000..17ba4d75f Binary files /dev/null and b/export_delete_login_log/static/description/assets/modules/4.png differ diff --git a/export_delete_login_log/static/description/assets/modules/5.png b/export_delete_login_log/static/description/assets/modules/5.png new file mode 100644 index 000000000..489f44e86 Binary files /dev/null and b/export_delete_login_log/static/description/assets/modules/5.png differ diff --git a/export_delete_login_log/static/description/assets/modules/6.png b/export_delete_login_log/static/description/assets/modules/6.png new file mode 100644 index 000000000..ed11bd818 Binary files /dev/null and b/export_delete_login_log/static/description/assets/modules/6.png differ diff --git a/export_delete_login_log/static/description/assets/screenshots/Screenshot1.png b/export_delete_login_log/static/description/assets/screenshots/Screenshot1.png new file mode 100644 index 000000000..e5324b214 Binary files /dev/null and b/export_delete_login_log/static/description/assets/screenshots/Screenshot1.png differ diff --git a/export_delete_login_log/static/description/assets/screenshots/Screenshot2.png b/export_delete_login_log/static/description/assets/screenshots/Screenshot2.png new file mode 100644 index 000000000..18fc7f2ed Binary files /dev/null and b/export_delete_login_log/static/description/assets/screenshots/Screenshot2.png differ diff --git a/export_delete_login_log/static/description/assets/screenshots/Screenshot3.png b/export_delete_login_log/static/description/assets/screenshots/Screenshot3.png new file mode 100644 index 000000000..4728b69c2 Binary files /dev/null and b/export_delete_login_log/static/description/assets/screenshots/Screenshot3.png differ diff --git a/export_delete_login_log/static/description/assets/screenshots/Screenshot4.png b/export_delete_login_log/static/description/assets/screenshots/Screenshot4.png new file mode 100644 index 000000000..6c36a4c41 Binary files /dev/null and b/export_delete_login_log/static/description/assets/screenshots/Screenshot4.png differ diff --git a/export_delete_login_log/static/description/assets/screenshots/Screenshot5.png b/export_delete_login_log/static/description/assets/screenshots/Screenshot5.png new file mode 100644 index 000000000..37a652b74 Binary files /dev/null and b/export_delete_login_log/static/description/assets/screenshots/Screenshot5.png differ diff --git a/export_delete_login_log/static/description/assets/screenshots/Screenshot6.png b/export_delete_login_log/static/description/assets/screenshots/Screenshot6.png new file mode 100644 index 000000000..73474a0ce Binary files /dev/null and b/export_delete_login_log/static/description/assets/screenshots/Screenshot6.png differ diff --git a/export_delete_login_log/static/description/assets/screenshots/Screenshot7.png b/export_delete_login_log/static/description/assets/screenshots/Screenshot7.png new file mode 100644 index 000000000..989129132 Binary files /dev/null and b/export_delete_login_log/static/description/assets/screenshots/Screenshot7.png differ diff --git a/export_delete_login_log/static/description/assets/screenshots/hero.gif b/export_delete_login_log/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..090f4ccc3 Binary files /dev/null and b/export_delete_login_log/static/description/assets/screenshots/hero.gif differ diff --git a/export_delete_login_log/static/description/banner.jpg b/export_delete_login_log/static/description/banner.jpg new file mode 100644 index 000000000..1da4e9473 Binary files /dev/null and b/export_delete_login_log/static/description/banner.jpg differ diff --git a/export_delete_login_log/static/description/icon.png b/export_delete_login_log/static/description/icon.png new file mode 100644 index 000000000..2c7e22afa Binary files /dev/null and b/export_delete_login_log/static/description/icon.png differ diff --git a/export_delete_login_log/static/description/index.html b/export_delete_login_log/static/description/index.html new file mode 100644 index 000000000..883b97d6f --- /dev/null +++ b/export_delete_login_log/static/description/index.html @@ -0,0 +1,679 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + + +

+ Export, Delete, Login Log

+

+ Logs information about Export, Delete, Login

+ + + +
+ + +
+
+ +
+

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ It is the responsibility of a business owner to make sure that the information + in the database are safe and secure. This app will help you to in make this happen, + 'Export, Delete, Login Log' app will create a log record when record is deleted + along with information like who, when and what record is deleted. It will do the same in the case + when a record is exported it will also include information about which all fields are exported. + And finally it also create a log record when a user logged in with information like IP Address, + Latitude / Longitude, Address, Postal Code, Time Zone, etc. This app will fetch information like IP Address, + Latitude / Longitude, Address, Postal Code, Time Zone, 'etc.' for free up to 1000 fetches/day. So in that case + the app allows you to purchase and add an API key. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + View to log can be limited. +
+
+ + Delete Log for added security. +
+
+ + Added security to the database. +
+
+ + Export log with exported fields information. +
+
+ + Login Log with IP address, Geo-location, physical location. +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Enable Permission to View Logs

+

+ Go to Settings -> Users Select the user wish to give permissions + to view logs, and give Administrator permission to each of the logs.

+ +
+ +
+

+ Delete Log and Login Log Configuration

+

+ You can decide which all models have to be tracked, Add those models + under Delete Tracked Models. "ipapi" is an external API which helps + in fetching login details like Geolocation, Address, Postal + Code, etc. Its free version is available for 1000 request/day. If + you have a requirement of more than that you can purchase an api key + from https://ipapi.co/#pricing and add the Key here.

+ +
+ +
+

+ Log Menu

+

+ Here you can view and access menu according to the permission given.

+ +
+ +
+

+ Export Log

+

+ It contains information like Export Date, Record Name, Exported + Fields, Exported by, etc.

+ +
+ +
+

+ Delete Log

+

+ It contains information like Record ID, Record Name, Delete Date, etc.

+ +
+ +
+

+ Login Log

+

+ It contains information like IP Address, Geolocation, Address, + Postal Code, Time Zone, etc.

+ +
+ +
+

+ Records in login log will be highlighted in red colour means + there is any issue with the IP address of the user.

+ +
+
+
+ + + +
+
+ +
+

+ Related + Products +

+
+
+
+ +
+
+ + + + +
+
+ +
+

+ Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

+ Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + + + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/export_delete_login_log/static/src/js/export_data.js b/export_delete_login_log/static/src/js/export_data.js new file mode 100644 index 000000000..cf44d6119 --- /dev/null +++ b/export_delete_login_log/static/src/js/export_data.js @@ -0,0 +1,33 @@ +/** @odoo-module **/ +import { ExportDataDialog } from "@web/views/view_dialogs/export_data_dialog"; +import { patch } from "@web/core/utils/patch"; + +patch(ExportDataDialog.prototype, 'export_print', { + setup () { + this._super() + }, + async onClickExportButton() { + this._super() + // To modify on click function + let list = { + records: this.props.root.records.filter( + element => { + return element.selected === true + } + ).map(r => { + return { rec_id: r.resId, + rec_model: r.resModel, + }; + }), + exportList: this.state.exportList.map( + r => { + return { field_name: r.id, + } + } + ), + } + await this.orm.call( + "export.log", "action_create_export_log", [0, list] + ) + } +}); diff --git a/export_delete_login_log/views/delete_log_views.xml b/export_delete_login_log/views/delete_log_views.xml new file mode 100644 index 000000000..1269497ca --- /dev/null +++ b/export_delete_login_log/views/delete_log_views.xml @@ -0,0 +1,57 @@ + + + + + delete.log.view.tree + delete.log + + + + + + + + + + + + + delete.log.view.form + delete.log + +
+ + + + + + + + + + + + + +
+
+
+ + + Delete Log + ir.actions.act_window + delete.log + tree,form + +

+ Currently there is nothing in log. +

+
+
+ + + +
diff --git a/export_delete_login_log/views/export_log_views.xml b/export_delete_login_log/views/export_log_views.xml new file mode 100644 index 000000000..8179744cd --- /dev/null +++ b/export_delete_login_log/views/export_log_views.xml @@ -0,0 +1,57 @@ + + + + + export.log.view.tree + export.log + + + + + + + + + + + + + + export.log.view.form + export.log + +
+ + + + + + + + + + +
+
+
+ + + Export Log + ir.actions.act_window + export.log + tree,form + +

+ Currently there is nothing in log. +

+
+
+ + + +
diff --git a/export_delete_login_log/views/login_user_log_views.xml b/export_delete_login_log/views/login_user_log_views.xml new file mode 100644 index 000000000..43c49de0c --- /dev/null +++ b/export_delete_login_log/views/login_user_log_views.xml @@ -0,0 +1,62 @@ + + + + + login.log.view.form + login.log + +
+ + + + + + + + + + + + + + + + +
+
+
+ + + login.log.view.tree + login.log + + + + + + + + + + + + + + + + Login Log + ir.actions.act_window + login.log + tree,form + +

+ Currently there is nothing in log. +

+
+
+ + +
diff --git a/export_delete_login_log/views/res_config_settings_views.xml b/export_delete_login_log/views/res_config_settings_views.xml new file mode 100644 index 000000000..7f85048f1 --- /dev/null +++ b/export_delete_login_log/views/res_config_settings_views.xml @@ -0,0 +1,58 @@ + + + + + res.config.settings.export.delete.login.log.view.form.inherit + res.config.settings + + + +
+

Log Configuration

+
+
+ Deleting Tracked + Models +
+ Models whose deleting should be tracked +
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+