diff --git a/odoo_record_rollback/README.rst b/odoo_record_rollback/README.rst new file mode 100644 index 000000000..8e1fdc373 --- /dev/null +++ b/odoo_record_rollback/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Record Rollback +=============== +App for retrieve the edited records history. + +Installation +============ + - www.odoo.com/documentation/16.0/setup/install.html + - Install our custom addon + +License +------- +GNU AFFERO GENERAL PUBLIC LICENSE v3.0 (AGPL-3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: Cybrosys Techno Solutions odoo@cybrosys.com + Version 16: Prathyunnan R @cybrosys + +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 `__ + +Further information +=================== +HTML Description: ``__ \ No newline at end of file diff --git a/odoo_record_rollback/__init__.py b/odoo_record_rollback/__init__.py new file mode 100644 index 000000000..4748c93aa --- /dev/null +++ b/odoo_record_rollback/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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/odoo_record_rollback/__manifest__.py b/odoo_record_rollback/__manifest__.py new file mode 100644 index 000000000..4a7f7b3a7 --- /dev/null +++ b/odoo_record_rollback/__manifest__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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': 'Record RollBack', + 'version': '16.0.1.0.0', + 'category': 'Extra Tools', + 'summary': 'Manage your history of edited records.', + 'description': """This app will save all the records that are edited from + any models, and helps to rollback to its history.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'web'], + 'data': [ + 'security/ir.model.access.csv', + 'views/rollback_record_views.xml', + 'views/res_config_settings_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'odoo_record_rollback/static/src/xml/rollback_form_button.xml', + 'odoo_record_rollback/static/src/js/rollback_form_button.js', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/odoo_record_rollback/doc/RELEASE_NOTES.md b/odoo_record_rollback/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..d4c21d1c5 --- /dev/null +++ b/odoo_record_rollback/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 20.07.2023 +#### Version 16.0.1.0.0 +#### ADD +- Initial commit for Record RollBack \ No newline at end of file diff --git a/odoo_record_rollback/models/__init__.py b/odoo_record_rollback/models/__init__.py new file mode 100644 index 000000000..602c0f7d7 --- /dev/null +++ b/odoo_record_rollback/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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 base +from . import res_config_settings +from . import rollback_record diff --git a/odoo_record_rollback/models/base.py b/odoo_record_rollback/models/base.py new file mode 100644 index 000000000..68c49d2b1 --- /dev/null +++ b/odoo_record_rollback/models/base.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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 json +from odoo import models + + +class Base(models.AbstractModel): + """To fetch records edited and added into Rollback.Record model.""" + _inherit = 'base' + + def write(self, vals): + """Creates record when a write function called from any of the base + models, and store it in rollback model""" + for rec in self: + if self._name != 'ir.module.module': + self.env['rollback.record'].create({ + 'res_model': self._name, + 'record': rec.id, + 'history': json.dumps(vals, indent=4, sort_keys=True, + default=str) + }) + return super(Base, self).write(vals) diff --git a/odoo_record_rollback/models/res_config_settings.py b/odoo_record_rollback/models/res_config_settings.py new file mode 100644 index 000000000..88db72b30 --- /dev/null +++ b/odoo_record_rollback/models/res_config_settings.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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 ast import literal_eval +from odoo import api, fields, models + + +class ResConfigSettings(models.TransientModel): + """Adding configuration settings for the module.""" + _inherit = 'res.config.settings' + + res_rollback_model_ids = fields.Many2many('ir.model', string='Models', + help="Configuration field" + " to add the models that" + " needs rollback feature.") + + def set_values(self): + # Setting the value for Many2many field in the configuration + res = super(ResConfigSettings, self).set_values() + self.env['ir.config_parameter'].sudo().set_param( + 'odoo_record_rollback.res_rollback_model_ids', + self.res_rollback_model_ids.ids) + return res + + @api.model + def get_values(self): + # Get the values from the Many2many field + res = super(ResConfigSettings, self).get_values() + with_user = self.env['ir.config_parameter'].sudo() + com_contacts = with_user.get_param( + 'odoo_record_rollback.res_rollback_model_ids') + res.update(res_rollback_model_ids=[(6, 0, + literal_eval(com_contacts)) + ]if com_contacts else False) + return res diff --git a/odoo_record_rollback/models/rollback_record.py b/odoo_record_rollback/models/rollback_record.py new file mode 100644 index 000000000..015f8ebe7 --- /dev/null +++ b/odoo_record_rollback/models/rollback_record.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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 json +from odoo import fields, models + + +class RollBackRecord(models.Model): + """To keep History of edited records.""" + _name = 'rollback.record' + _description = 'Record History' + + history = fields.Text(String='Record History', + help="The affected fields and " + "their values will be shown.") + res_model = fields.Char(string='Model', + help="Shows which model is subject to editing?") + record = fields.Integer(string='Record ID', + help="Shows the id of the record") + user = fields.Char(string='Edited By', default=lambda self: self.env.user, + help="Technical field finding the person responsible " + "for the edit.") + write_time = fields.Datetime(string='Time', default=fields.Datetime.now, + help="Technical field shows the time at which" + "the record was edited.") + + def action_record_selection(self): + """Selected record will update the current record""" + json_load = json.loads(self.history) + self.env[self.res_model].browse(self.record).sudo().write( + {keys: json_load[keys] for keys in json_load.keys()}) + return { + 'type': 'ir.actions.client', + 'tag': 'reload' + } + + def get_models(self): + """To get the model added in the settings""" + many2many_field_ids = self.env['res.config.settings'].create({ + + }).res_rollback_model_ids.ids + return [x.model for x in self.env['ir.model'].browse( + many2many_field_ids)] diff --git a/odoo_record_rollback/security/ir.model.access.csv b/odoo_record_rollback/security/ir.model.access.csv new file mode 100644 index 000000000..803f6efdc --- /dev/null +++ b/odoo_record_rollback/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +access_rollback_record,access.rollback.record,model_rollback_record,base.group_user,1,1,1,1 diff --git a/odoo_record_rollback/static/description/assets/icons/check.png b/odoo_record_rollback/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/check.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/chevron.png b/odoo_record_rollback/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/chevron.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/cogs.png b/odoo_record_rollback/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/cogs.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/consultation.png b/odoo_record_rollback/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/consultation.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/ecom-black.png b/odoo_record_rollback/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/ecom-black.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/education-black.png b/odoo_record_rollback/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/education-black.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/hotel-black.png b/odoo_record_rollback/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/hotel-black.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/license.png b/odoo_record_rollback/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/license.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/lifebuoy.png b/odoo_record_rollback/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/lifebuoy.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/manufacturing-black.png b/odoo_record_rollback/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/manufacturing-black.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/pos-black.png b/odoo_record_rollback/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/pos-black.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/puzzle.png b/odoo_record_rollback/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/puzzle.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/restaurant-black.png b/odoo_record_rollback/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/restaurant-black.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/service-black.png b/odoo_record_rollback/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/service-black.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/trading-black.png b/odoo_record_rollback/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/trading-black.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/training.png b/odoo_record_rollback/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/training.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/update.png b/odoo_record_rollback/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/update.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/user.png b/odoo_record_rollback/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/user.png differ diff --git a/odoo_record_rollback/static/description/assets/icons/wrench.png b/odoo_record_rollback/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/odoo_record_rollback/static/description/assets/icons/wrench.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/categories.png b/odoo_record_rollback/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/categories.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/check-box.png b/odoo_record_rollback/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/check-box.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/compass.png b/odoo_record_rollback/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/compass.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/corporate.png b/odoo_record_rollback/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/corporate.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/customer-support.png b/odoo_record_rollback/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/customer-support.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/cybrosys-logo.png b/odoo_record_rollback/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/cybrosys-logo.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/features.png b/odoo_record_rollback/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/features.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/logo.png b/odoo_record_rollback/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/logo.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/pictures.png b/odoo_record_rollback/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/pictures.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/pie-chart.png b/odoo_record_rollback/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/pie-chart.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/right-arrow.png b/odoo_record_rollback/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/right-arrow.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/star.png b/odoo_record_rollback/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/star.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/support.png b/odoo_record_rollback/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/support.png differ diff --git a/odoo_record_rollback/static/description/assets/misc/whatsapp.png b/odoo_record_rollback/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/misc/whatsapp.png differ diff --git a/odoo_record_rollback/static/description/assets/modules/1.png b/odoo_record_rollback/static/description/assets/modules/1.png new file mode 100644 index 000000000..2c8fbb83f Binary files /dev/null and b/odoo_record_rollback/static/description/assets/modules/1.png differ diff --git a/odoo_record_rollback/static/description/assets/modules/2.png b/odoo_record_rollback/static/description/assets/modules/2.png new file mode 100644 index 000000000..17ba4d75f Binary files /dev/null and b/odoo_record_rollback/static/description/assets/modules/2.png differ diff --git a/odoo_record_rollback/static/description/assets/modules/3.png b/odoo_record_rollback/static/description/assets/modules/3.png new file mode 100644 index 000000000..a29119785 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/modules/3.png differ diff --git a/odoo_record_rollback/static/description/assets/modules/4.png b/odoo_record_rollback/static/description/assets/modules/4.png new file mode 100644 index 000000000..3add135c3 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/modules/4.png differ diff --git a/odoo_record_rollback/static/description/assets/modules/5.png b/odoo_record_rollback/static/description/assets/modules/5.png new file mode 100644 index 000000000..31ed46762 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/modules/5.png differ diff --git a/odoo_record_rollback/static/description/assets/modules/6.gif b/odoo_record_rollback/static/description/assets/modules/6.gif new file mode 100644 index 000000000..0b7368dc0 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/modules/6.gif differ diff --git a/odoo_record_rollback/static/description/assets/screenshots/hero.gif b/odoo_record_rollback/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..1a81c27c2 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/screenshots/hero.gif differ diff --git a/odoo_record_rollback/static/description/assets/screenshots/screenshot_1.png b/odoo_record_rollback/static/description/assets/screenshots/screenshot_1.png new file mode 100644 index 000000000..6e2be2ffa Binary files /dev/null and b/odoo_record_rollback/static/description/assets/screenshots/screenshot_1.png differ diff --git a/odoo_record_rollback/static/description/assets/screenshots/screenshot_2.png b/odoo_record_rollback/static/description/assets/screenshots/screenshot_2.png new file mode 100644 index 000000000..7645e00b0 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/screenshots/screenshot_2.png differ diff --git a/odoo_record_rollback/static/description/assets/screenshots/screenshot_3.png b/odoo_record_rollback/static/description/assets/screenshots/screenshot_3.png new file mode 100644 index 000000000..26eab900c Binary files /dev/null and b/odoo_record_rollback/static/description/assets/screenshots/screenshot_3.png differ diff --git a/odoo_record_rollback/static/description/assets/screenshots/screenshot_4.png b/odoo_record_rollback/static/description/assets/screenshots/screenshot_4.png new file mode 100644 index 000000000..f77c90e5a Binary files /dev/null and b/odoo_record_rollback/static/description/assets/screenshots/screenshot_4.png differ diff --git a/odoo_record_rollback/static/description/assets/screenshots/screenshot_5.png b/odoo_record_rollback/static/description/assets/screenshots/screenshot_5.png new file mode 100644 index 000000000..b4107ba76 Binary files /dev/null and b/odoo_record_rollback/static/description/assets/screenshots/screenshot_5.png differ diff --git a/odoo_record_rollback/static/description/banner.png b/odoo_record_rollback/static/description/banner.png new file mode 100644 index 000000000..0ae7f6425 Binary files /dev/null and b/odoo_record_rollback/static/description/banner.png differ diff --git a/odoo_record_rollback/static/description/icon.png b/odoo_record_rollback/static/description/icon.png new file mode 100644 index 000000000..2fdd32756 Binary files /dev/null and b/odoo_record_rollback/static/description/icon.png differ diff --git a/odoo_record_rollback/static/description/index.html b/odoo_record_rollback/static/description/index.html new file mode 100644 index 000000000..a208bf652 --- /dev/null +++ b/odoo_record_rollback/static/description/index.html @@ -0,0 +1,650 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+
+ +
+
+
+ +

+ Record Rollback

+

+ Rollback your record from the edited history.

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module backup all the records that was edited and helps the user to roll back to its previous edited records. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Community & + Enterprise Support. +
+
+ + Possible to add the models that needs rollback feature in the configuration settings. +
+
+ + Only the rollback feature will get on the models which is added in the configuration. +
+
+ + Edits on each field will save as history. +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

+ Add your models that needs rollback feature. +

+ + +
+ +
+

+ The rollback button will appear on added models.

+ +
+ +
+

+ All the edited record history will be shown in the wizard.

+ +
+ +
+

+ By selecting any of the history record it will replace the current record with history.

+ +
+ +
+

+ All the edited records from every model to be saved on Rollback Record model.

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

+ 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

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/odoo_record_rollback/static/src/js/rollback_form_button.js b/odoo_record_rollback/static/src/js/rollback_form_button.js new file mode 100644 index 000000000..906919534 --- /dev/null +++ b/odoo_record_rollback/static/src/js/rollback_form_button.js @@ -0,0 +1,42 @@ +/** @odoo-module **/ +import { patch } from "@web/core/utils/patch"; +import { FormController } from "@web/views/form/form_controller"; +import { useService } from "@web/core/utils/hooks"; +var rpc = require('web.rpc'); +const { onWillStart, useState } = owl; +patch(FormController.prototype, "rollback", { + // Patched the form controller to control the rollback button in every record. + setup(){ + this._super.apply(); + this.action = useService("action") + this.values = useState({ + val: [] + }) + onWillStart(async () => { + var self = this + await rpc.query({ + model: 'rollback.record', + method: 'get_models', + args: [[this.props.resModel]] + }).then(result => { + const val = result; + self.values.val = val; + }) + }); + }, + rollbackButtonClicked(){ + // To show the history of edited record + const resId = this.__owl__.component.props.resId + const resModel = this.__owl__.component.props.resModel + this.action.doAction({ + type: 'ir.actions.act_window', + name: 'Roll Back Records', + view_mode: 'list', + views:[[false,"list"]], + res_model: 'rollback.record', + target: 'new', + context: "{'create' : False}", + domain: [["record", "=", resId], ["res_model", "=", resModel]] + }) + } +}); \ No newline at end of file diff --git a/odoo_record_rollback/static/src/xml/rollback_form_button.xml b/odoo_record_rollback/static/src/xml/rollback_form_button.xml new file mode 100644 index 000000000..9ff53d0ae --- /dev/null +++ b/odoo_record_rollback/static/src/xml/rollback_form_button.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/odoo_record_rollback/views/res_config_settings_views.xml b/odoo_record_rollback/views/res_config_settings_views.xml new file mode 100644 index 000000000..f2d73934e --- /dev/null +++ b/odoo_record_rollback/views/res_config_settings_views.xml @@ -0,0 +1,54 @@ + + + + + + res.config.settings.view.form.inherit.odoo.record.rollback + + res.config.settings + + + + +
+

Models Available

+
+ +
+ Added models will get the record rollback feature. +
+
+
+ +
+
+
+
+
+
+
+ + + Settings + ir.actions.act_window + res.config.settings + + form + inline + {'module' : 'odoo_record_rollback', 'bin_size': + False} + + + + + + +
diff --git a/odoo_record_rollback/views/rollback_record_views.xml b/odoo_record_rollback/views/rollback_record_views.xml new file mode 100644 index 000000000..92206bd6b --- /dev/null +++ b/odoo_record_rollback/views/rollback_record_views.xml @@ -0,0 +1,50 @@ + + + + + rollback.record.view.search + rollback.record + + + + + + + + + + + + + rollback.record.view.tree + rollback.record + + +