diff --git a/view_any_model/README.rst b/view_any_model/README.rst new file mode 100755 index 000000000..e7342a883 --- /dev/null +++ b/view_any_model/README.rst @@ -0,0 +1,42 @@ +.. 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 + +View Any Model +============== +This module allow to view records of all modules. + +Configuration +============= +The user should be in any of the Administration security groups: Access Rights or Settings. Add the users to the new security group to give access to the new menu. + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: Abhishek E T @cybrosys, Contact: odoo@cybrosys.com + version 14 & 15: Abhishek E T @cybrosys, 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 `__ + +Further information +=================== +HTML Description: ``__ diff --git a/view_any_model/__init__.py b/view_any_model/__init__.py new file mode 100644 index 000000000..f896d5ff8 --- /dev/null +++ b/view_any_model/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Author: Abhishek E T (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 wizard diff --git a/view_any_model/__manifest__.py b/view_any_model/__manifest__.py new file mode 100644 index 000000000..918aa06d8 --- /dev/null +++ b/view_any_model/__manifest__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Author: Abhishek E T (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': 'View Records Of Any Model', + 'version': '15.0.1.0.0', + 'category': 'Technical', + 'summary': 'View Records Of Any Model in Tree and Form View', + 'description': 'View Records Of Any Model in Tree and Form View', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'images': ['static/description/banner.png'], + 'website': 'https://www.cybrosys.com', + 'depends': ['base'], + 'data': [ + 'security/view_any_model_groups.xml', + 'security/ir.model.access.csv', + 'wizard/view_any_model_views.xml' + ], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/view_any_model/doc/RELEASE_NOTES.md b/view_any_model/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..500f684dd --- /dev/null +++ b/view_any_model/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 31.05.2022 +#### Version 15.0.1.0.0 +#### ADD + +- Initial commit for View Any Model diff --git a/view_any_model/security/ir.model.access.csv b/view_any_model/security/ir.model.access.csv new file mode 100644 index 000000000..6a4c8090e --- /dev/null +++ b/view_any_model/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_view_any_model,view.any.model,model_view_any_model,base.group_user,1,1,1,1 diff --git a/view_any_model/security/view_any_model_groups.xml b/view_any_model/security/view_any_model_groups.xml new file mode 100644 index 000000000..7b8873470 --- /dev/null +++ b/view_any_model/security/view_any_model_groups.xml @@ -0,0 +1,10 @@ + + + + + View Any Model + Show View Any Model Menu in Technical Menus + + + + \ No newline at end of file diff --git a/view_any_model/static/description/assets/icons/check.png b/view_any_model/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/view_any_model/static/description/assets/icons/check.png differ diff --git a/view_any_model/static/description/assets/icons/chevron.png b/view_any_model/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/view_any_model/static/description/assets/icons/chevron.png differ diff --git a/view_any_model/static/description/assets/icons/cogs.png b/view_any_model/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/view_any_model/static/description/assets/icons/cogs.png differ diff --git a/view_any_model/static/description/assets/icons/consultation.png b/view_any_model/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/view_any_model/static/description/assets/icons/consultation.png differ diff --git a/view_any_model/static/description/assets/icons/ecom-black.png b/view_any_model/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/view_any_model/static/description/assets/icons/ecom-black.png differ diff --git a/view_any_model/static/description/assets/icons/education-black.png b/view_any_model/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/view_any_model/static/description/assets/icons/education-black.png differ diff --git a/view_any_model/static/description/assets/icons/hotel-black.png b/view_any_model/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/view_any_model/static/description/assets/icons/hotel-black.png differ diff --git a/view_any_model/static/description/assets/icons/license.png b/view_any_model/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/view_any_model/static/description/assets/icons/license.png differ diff --git a/view_any_model/static/description/assets/icons/lifebuoy.png b/view_any_model/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/view_any_model/static/description/assets/icons/lifebuoy.png differ diff --git a/view_any_model/static/description/assets/icons/logo.png b/view_any_model/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/view_any_model/static/description/assets/icons/logo.png differ diff --git a/view_any_model/static/description/assets/icons/manufacturing-black.png b/view_any_model/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/view_any_model/static/description/assets/icons/manufacturing-black.png differ diff --git a/view_any_model/static/description/assets/icons/pos-black.png b/view_any_model/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/view_any_model/static/description/assets/icons/pos-black.png differ diff --git a/view_any_model/static/description/assets/icons/puzzle.png b/view_any_model/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/view_any_model/static/description/assets/icons/puzzle.png differ diff --git a/view_any_model/static/description/assets/icons/restaurant-black.png b/view_any_model/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/view_any_model/static/description/assets/icons/restaurant-black.png differ diff --git a/view_any_model/static/description/assets/icons/service-black.png b/view_any_model/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/view_any_model/static/description/assets/icons/service-black.png differ diff --git a/view_any_model/static/description/assets/icons/trading-black.png b/view_any_model/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/view_any_model/static/description/assets/icons/trading-black.png differ diff --git a/view_any_model/static/description/assets/icons/training.png b/view_any_model/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/view_any_model/static/description/assets/icons/training.png differ diff --git a/view_any_model/static/description/assets/icons/update.png b/view_any_model/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/view_any_model/static/description/assets/icons/update.png differ diff --git a/view_any_model/static/description/assets/icons/user.png b/view_any_model/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/view_any_model/static/description/assets/icons/user.png differ diff --git a/view_any_model/static/description/assets/icons/wrench.png b/view_any_model/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/view_any_model/static/description/assets/icons/wrench.png differ diff --git a/view_any_model/static/description/assets/modules/budget_image.png b/view_any_model/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..b50130c7d Binary files /dev/null and b/view_any_model/static/description/assets/modules/budget_image.png differ diff --git a/view_any_model/static/description/assets/modules/credit_image.png b/view_any_model/static/description/assets/modules/credit_image.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/view_any_model/static/description/assets/modules/credit_image.png differ diff --git a/view_any_model/static/description/assets/modules/employee_image.png b/view_any_model/static/description/assets/modules/employee_image.png new file mode 100644 index 000000000..30ad58232 Binary files /dev/null and b/view_any_model/static/description/assets/modules/employee_image.png differ diff --git a/view_any_model/static/description/assets/modules/export_image.png b/view_any_model/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/view_any_model/static/description/assets/modules/export_image.png differ diff --git a/view_any_model/static/description/assets/modules/gantt_image.png b/view_any_model/static/description/assets/modules/gantt_image.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/view_any_model/static/description/assets/modules/gantt_image.png differ diff --git a/view_any_model/static/description/assets/modules/quotation_image.png b/view_any_model/static/description/assets/modules/quotation_image.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/view_any_model/static/description/assets/modules/quotation_image.png differ diff --git a/view_any_model/static/description/assets/screenshots/hero.png b/view_any_model/static/description/assets/screenshots/hero.png new file mode 100644 index 000000000..bc72555c8 Binary files /dev/null and b/view_any_model/static/description/assets/screenshots/hero.png differ diff --git a/view_any_model/static/description/assets/screenshots/view_any_model_1.png b/view_any_model/static/description/assets/screenshots/view_any_model_1.png new file mode 100644 index 000000000..9c9741d84 Binary files /dev/null and b/view_any_model/static/description/assets/screenshots/view_any_model_1.png differ diff --git a/view_any_model/static/description/assets/screenshots/view_any_model_10.png b/view_any_model/static/description/assets/screenshots/view_any_model_10.png new file mode 100644 index 000000000..324bd099e Binary files /dev/null and b/view_any_model/static/description/assets/screenshots/view_any_model_10.png differ diff --git a/view_any_model/static/description/assets/screenshots/view_any_model_2.png b/view_any_model/static/description/assets/screenshots/view_any_model_2.png new file mode 100644 index 000000000..5b730ce9e Binary files /dev/null and b/view_any_model/static/description/assets/screenshots/view_any_model_2.png differ diff --git a/view_any_model/static/description/assets/screenshots/view_any_model_3.png b/view_any_model/static/description/assets/screenshots/view_any_model_3.png new file mode 100644 index 000000000..a6bca1cfd Binary files /dev/null and b/view_any_model/static/description/assets/screenshots/view_any_model_3.png differ diff --git a/view_any_model/static/description/assets/screenshots/view_any_model_4.png b/view_any_model/static/description/assets/screenshots/view_any_model_4.png new file mode 100644 index 000000000..74d0de534 Binary files /dev/null and b/view_any_model/static/description/assets/screenshots/view_any_model_4.png differ diff --git a/view_any_model/static/description/assets/screenshots/view_any_model_5.png b/view_any_model/static/description/assets/screenshots/view_any_model_5.png new file mode 100644 index 000000000..52f707701 Binary files /dev/null and b/view_any_model/static/description/assets/screenshots/view_any_model_5.png differ diff --git a/view_any_model/static/description/assets/screenshots/view_any_model_6.png b/view_any_model/static/description/assets/screenshots/view_any_model_6.png new file mode 100644 index 000000000..24c8ba787 Binary files /dev/null and b/view_any_model/static/description/assets/screenshots/view_any_model_6.png differ diff --git a/view_any_model/static/description/assets/screenshots/view_any_model_7.png b/view_any_model/static/description/assets/screenshots/view_any_model_7.png new file mode 100644 index 000000000..8583f68f2 Binary files /dev/null and b/view_any_model/static/description/assets/screenshots/view_any_model_7.png differ diff --git a/view_any_model/static/description/assets/screenshots/view_any_model_8.png b/view_any_model/static/description/assets/screenshots/view_any_model_8.png new file mode 100644 index 000000000..2e8437153 Binary files /dev/null and b/view_any_model/static/description/assets/screenshots/view_any_model_8.png differ diff --git a/view_any_model/static/description/assets/screenshots/view_any_model_9.png b/view_any_model/static/description/assets/screenshots/view_any_model_9.png new file mode 100644 index 000000000..0c5180708 Binary files /dev/null and b/view_any_model/static/description/assets/screenshots/view_any_model_9.png differ diff --git a/view_any_model/static/description/banner.png b/view_any_model/static/description/banner.png new file mode 100644 index 000000000..0c9266e25 Binary files /dev/null and b/view_any_model/static/description/banner.png differ diff --git a/view_any_model/static/description/icon.png b/view_any_model/static/description/icon.png new file mode 100644 index 000000000..ba99e87f6 Binary files /dev/null and b/view_any_model/static/description/icon.png differ diff --git a/view_any_model/static/description/index.html b/view_any_model/static/description/index.html new file mode 100644 index 000000000..ef753996d --- /dev/null +++ b/view_any_model/static/description/index.html @@ -0,0 +1,548 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+
+
+
+ +
+
+
+

+ View Any Model +

+

+ This module allows to view the records of any model in tree or form view +

+ +
+
+ + + +
+
+

+ Overview +

+
+ +
+

+ This module crafted by Cybrosys Technologies provides an option to view the records of any model in tree or form view. +

+
+
+ +
+
+

+ Configuration +

+
+
+

The user should be in any of the Administration security groups: Access Rights or Settings. Add the users to the new security group to give access to the new menu.

+ +
+
+ +
+
+

+ Features +

+
+
+
+ +
+
+

+ New wizard

+

+ Use the new wizard in Technical Menu of Settings to view the records of the selected model. +

+
+
+
+
+ +
+
+

+ Form and Tree view

+

+ The records can be viewed in either tree or form view. +

+
+
+
+ +
+
+

+ Screenshots +

+
+
+

New menu

+

+ Open Settings App and enable the developer mode. Technical -> Database Structure -> View Any Model. +

+ +
+
+

Fill fields for tree view

+

+ Select the View Type as Tree and enter the model name. If the model name is known, type to get the model in the dropdown. The model description will be shown in the drop down. +

+ +
+
+

Make search more easy

+

+ We cannot search for the model using the model description, which is shown in the dropdown list. So, you can use the Search More... option to view all the models in tree view. Use the available filters to find and select the required model. +

+ +
+
+

Use the domain for filter records

+

+ Add the domain for filtering the records. To get all records, leave the domain as empty. +

+ +
+
+

View the available records

+

+ We can see the number of records after filtering the records using the domain. Click on the View button to view the records. +

+ +
+
+

Tree view

+

+ All the records for the selected model with the filter domain will be listed in the tree view. +

+ +
+
+

Open the form view of any record

+

+ Click on any record from the tree view to get the form view of that record. +

+ +
+
+

Fill fields for tree view

+

+ Select the View Type as Form and enter the ID of the record and the model name. Then click the View button to view the record in form view. +

+ +
+
+

Form view

+

+ The record for the selected model can be viewed in the form view. +

+ +
+
+ + +
+
+

Suggested 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 +

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

Need Help?

+
+
+
+ + +
+ + + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/view_any_model/wizard/__init__.py b/view_any_model/wizard/__init__.py new file mode 100644 index 000000000..9b0140036 --- /dev/null +++ b/view_any_model/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Author: Abhishek E T (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 view_any_model diff --git a/view_any_model/wizard/view_any_model.py b/view_any_model/wizard/view_any_model.py new file mode 100644 index 000000000..8c0fe3844 --- /dev/null +++ b/view_any_model/wizard/view_any_model.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies(). +# Author: Abhishek E T (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, _ +from odoo.exceptions import UserError + + +class ViewAnyModel(models.TransientModel): + _name = 'view.any.model' + _description = 'View Any Model' + + view_type = fields.Selection( + selection=[('tree', 'Tree'), ('form', 'Form')], string='View Type', + default='tree', required=True) + record_id = fields.Integer(string="ID", default="1") + model_id = fields.Many2one('ir.model', string='Model', ondelete='set null') + model_name = fields.Char(related='model_id.model', string='Model Name', + readonly=True, store=True) + filter_domain = fields.Char(string='Apply on') + + def action_view_model(self): + """ + + :return: tree/ form view of selected model + """ + if self.view_type == 'form': + if self.record_id < 1: + raise UserError(_("ID should be a positive integer")) + if not self.env[self.model_name].sudo().search( + [('id', '=', self.record_id)]): + raise UserError(_("Enter ID of existing record")) + domain = self.filter_domain + if not domain: + domain = [] + action = { + 'name': self.model_id.name, + 'type': 'ir.actions.act_window', + 'res_model': self.model_name, + 'view_id': False, + 'target': 'main', + 'domain': domain, + 'context': { + 'create': False, + 'edit': False, + 'delete': False, + 'copy': False + } + } + if self.view_type == 'form': + action.update({ + 'res_id': self.record_id, + 'view_mode': 'form', + 'views': [(False, 'form')], + }) + else: + action.update({ + 'view_mode': 'tree,form', + 'views': [(False, 'tree'), (False, 'form')], + }) + return action diff --git a/view_any_model/wizard/view_any_model_views.xml b/view_any_model/wizard/view_any_model_views.xml new file mode 100644 index 000000000..d514a99cf --- /dev/null +++ b/view_any_model/wizard/view_any_model_views.xml @@ -0,0 +1,39 @@ + + + + + view.any.model.view.form + view.any.model + +
+ + + + + + + + + +
+
+
+ +
+
+ + + View Any Model + view.any.model + ir.actions.act_window + form + + new + + + + +
\ No newline at end of file