diff --git a/psql_query_execute/README.rst b/psql_query_execute/README.rst new file mode 100755 index 000000000..60adc17f0 --- /dev/null +++ b/psql_query_execute/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +PSQL Query Execute +================== +* PSQL Query Execute module helps to execute PSQL queries in the Odoo user interface. + +Configuration +============= +* The menu Psql Query lies inside the Technical menu of the Settings + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + + +Credits +------- +* Developer: (V16) Gion Dany + (V17) Anjhana A K + +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 https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/psql_query_execute/__init__.py b/psql_query_execute/__init__.py new file mode 100644 index 000000000..3fd5d2589 --- /dev/null +++ b/psql_query_execute/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers +from . import models diff --git a/psql_query_execute/__manifest__.py b/psql_query_execute/__manifest__.py new file mode 100644 index 000000000..368de2bd3 --- /dev/null +++ b/psql_query_execute/__manifest__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "PSQL Query Execute", + 'version': '17.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """Run the PSQL query in the Odoo user interface.""", + 'description': """PSQL Query Execute, SQL, PSQL, psql, query, odoo query, query run, database,""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'mail'], + 'data': [ + 'security/ir.model.access.csv', + 'views/psql_query_views.xml' + ], + 'assets': { + 'web.assets_backend': [ + 'psql_query_execute/static/src/js/action_manager.js', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': "LGPL-3", + 'installable': True, + 'auto_install': False, + 'application': False +} diff --git a/psql_query_execute/controllers/__init__.py b/psql_query_execute/controllers/__init__.py new file mode 100644 index 000000000..3be116e7e --- /dev/null +++ b/psql_query_execute/controllers/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import psql_query_execute diff --git a/psql_query_execute/controllers/psql_query_execute.py b/psql_query_execute/controllers/psql_query_execute.py new file mode 100644 index 000000000..672b1231c --- /dev/null +++ b/psql_query_execute/controllers/psql_query_execute.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import json +from odoo import http +from odoo.http import content_disposition, request, serialize_exception as _serialize_exception +from odoo.tools import html_escape + + +class XLSXReportController(http.Controller): + """ XLSX Report controller """ + + @http.route('/xlsx_reports', type='http', auth='user', + methods=['POST'], csrf=False) + def get_report_xlsx(self, model, options, output_format, + report_name, **kw): + """ Generate and retrieve an XLSX report. """ + options = json.loads(options) + report_obj = request.env[model].with_user(request.session.uid) + token = 'dummy-because-api-expects-one' + try: + if output_format == 'xlsx': + response = request.make_response( + None, + headers=[('Content-Type', 'application/vnd.ms-excel'), + ('Content-Disposition', content_disposition( + report_name + '.xlsx'))] + ) + report_obj.get_xlsx_report(options, response) + response.set_cookie('fileToken', token) + return response + except Exception as e: + error = { + 'code': 200, + 'message': 'Odoo Server Error', + 'data': _serialize_exception(e) + } + return request.make_response(html_escape(json.dumps(error))) diff --git a/psql_query_execute/doc/RELEASE_NOTES.md b/psql_query_execute/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..9b208e81b --- /dev/null +++ b/psql_query_execute/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 11.12.2023 +#### Version 17.0.1.0.0 +#### ADD +- Initial commit for PSQL Query Execute diff --git a/psql_query_execute/models/__init__.py b/psql_query_execute/models/__init__.py new file mode 100644 index 000000000..c1d1ec8eb --- /dev/null +++ b/psql_query_execute/models/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import psql_query diff --git a/psql_query_execute/models/psql_query.py b/psql_query_execute/models/psql_query.py new file mode 100644 index 000000000..4aaadb7fb --- /dev/null +++ b/psql_query_execute/models/psql_query.py @@ -0,0 +1,155 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author:Anjhana A K() +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import json +import io +from odoo import fields, models, _ +from odoo.tools import date_utils +from odoo.exceptions import ValidationError + +try: + from odoo.tools.misc import xlsxwriter +except ImportError: + import xlsxwriter + + +class PsqlQuery(models.Model): + """ This model executes a query directly in the Odoo user interface. """ + _name = 'psql.query' + _description = 'PostgreSQL Query' + _inherit = ['mail.thread', 'mail.activity.mixin'] + + name = fields.Char(string='Name', required=True, help="Query Name") + query_name = fields.Text(string='Query', required=True, + help="Type the query to execute") + query_result = fields.Html(string='Result', readonly=True, + help="Data output of the query") + + def action_execute_query(self): + """Execute the query operation""" + try: + if self.query_name: + self._cr.execute(self.query_name) + keys = [i[0] for i in self._cr.description] + table_header = '' + table_datas = '' + for key in keys: + table_header += ( + "%s" + "" % key) + query_result = self._cr.fetchall() + for query_res in query_result: + table_datas += "" + for res in query_res: + table_datas += ( + "{0}" + "".format(res)) + table_datas += "" + self.query_result = """
+ + + """ + str(table_header) + """ + """ + str(table_datas) + """
+
""" + except Exception as error: + raise ValidationError(_('Error executing SQL query: %s ', error)) + + def _get_report_data(self): + """Get the value of the data for which the query was executed""" + today = fields.Datetime.now().date() + result = [] + keys = '' + try: + if self.query_name: + self._cr.execute(self.query_name) + keys = [i[0] for i in self._cr.description] + for data in self._cr.fetchall(): + result.append(data) + except Exception as error: + raise ValidationError(_('Error executing SQL query: %s ', error)) + datas = { + 'ids': self, + 'model': 'psql.query', + 'no_value': False, + 'header': keys, + 'form': result, + 'date': today, + } + return datas + + def action_print_query_result_xlsx(self): + """Print the query result in Xlsx report""" + datas = self._get_report_data() + return { + 'type': 'ir.actions.report', + 'report_type': 'xlsx', + 'data': {'model': 'psql.query', + 'output_format': 'xlsx', + 'options': json.dumps(datas, + default=date_utils.json_default), + 'report_name': 'Query Report', + }, + } + + def get_xlsx_report(self, data, response): + """Set the position to print the data in xlsx file""" + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + sheet.set_default_row(19) + cmp_name = self.env.user.company_id.name or '' + txt_1 = workbook.add_format( + {'font_size': '10px', 'bold': True, 'align': 'center', + 'color': '#423642'}) + date_now = data['date'] + sheet.merge_range('A1:B1', 'Report Date: ' + date_now, txt_1) + sheet.merge_range('A2:B2', cmp_name, txt_1) + format1 = workbook.add_format( + {'font_size': 10, 'align': 'center', 'bg_color': '#edd8ed', + 'border': 1}) + format3 = workbook.add_format( + {'font_size': 10, 'align': 'center', 'bold': True, + 'bg_color': '#edd8ed', 'border': 1}) + count = 0 + row_number = 4 + record = data['header'] + column_number = 0 + for row in record: + count += 1 + sheet.merge_range(row_number - 1, column_number, row_number, + column_number, row, format3) + column_number += 1 + row_number = 5 + for val in data['form']: + column_number = 0 + for values in val: + if values is None: + sheet.write(row_number, column_number, 'None', format1) + else: + sheet.write(row_number, column_number, values, format1) + sheet.set_column(row_number, column_number, 15) + column_number += 1 + row_number += 1 + workbook.close() + output.seek(0) + response.stream.write(output.read()) + output.close() diff --git a/psql_query_execute/security/ir.model.access.csv b/psql_query_execute/security/ir.model.access.csv new file mode 100644 index 000000000..9f6fa63f8 --- /dev/null +++ b/psql_query_execute/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_psql_query,psql.query,model_psql_query,base.group_user,1,1,1,1 diff --git a/psql_query_execute/static/description/assets/icons/check.png b/psql_query_execute/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/check.png differ diff --git a/psql_query_execute/static/description/assets/icons/chevron.png b/psql_query_execute/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/chevron.png differ diff --git a/psql_query_execute/static/description/assets/icons/cogs.png b/psql_query_execute/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/cogs.png differ diff --git a/psql_query_execute/static/description/assets/icons/consultation.png b/psql_query_execute/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/consultation.png differ diff --git a/psql_query_execute/static/description/assets/icons/ecom-black.png b/psql_query_execute/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/ecom-black.png differ diff --git a/psql_query_execute/static/description/assets/icons/education-black.png b/psql_query_execute/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/education-black.png differ diff --git a/psql_query_execute/static/description/assets/icons/hotel-black.png b/psql_query_execute/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/hotel-black.png differ diff --git a/psql_query_execute/static/description/assets/icons/license.png b/psql_query_execute/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/license.png differ diff --git a/psql_query_execute/static/description/assets/icons/lifebuoy.png b/psql_query_execute/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/lifebuoy.png differ diff --git a/psql_query_execute/static/description/assets/icons/manufacturing-black.png b/psql_query_execute/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/manufacturing-black.png differ diff --git a/psql_query_execute/static/description/assets/icons/pos-black.png b/psql_query_execute/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/pos-black.png differ diff --git a/psql_query_execute/static/description/assets/icons/puzzle.png b/psql_query_execute/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/puzzle.png differ diff --git a/psql_query_execute/static/description/assets/icons/restaurant-black.png b/psql_query_execute/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/restaurant-black.png differ diff --git a/psql_query_execute/static/description/assets/icons/service-black.png b/psql_query_execute/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/service-black.png differ diff --git a/psql_query_execute/static/description/assets/icons/trading-black.png b/psql_query_execute/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/trading-black.png differ diff --git a/psql_query_execute/static/description/assets/icons/training.png b/psql_query_execute/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/training.png differ diff --git a/psql_query_execute/static/description/assets/icons/update.png b/psql_query_execute/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/update.png differ diff --git a/psql_query_execute/static/description/assets/icons/user.png b/psql_query_execute/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/user.png differ diff --git a/psql_query_execute/static/description/assets/icons/wrench.png b/psql_query_execute/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/wrench.png differ diff --git a/psql_query_execute/static/description/assets/misc/Cybrosys R.png b/psql_query_execute/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/Cybrosys R.png differ diff --git a/psql_query_execute/static/description/assets/misc/categories.png b/psql_query_execute/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/categories.png differ diff --git a/psql_query_execute/static/description/assets/misc/check-box.png b/psql_query_execute/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/check-box.png differ diff --git a/psql_query_execute/static/description/assets/misc/compass.png b/psql_query_execute/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/compass.png differ diff --git a/psql_query_execute/static/description/assets/misc/corporate.png b/psql_query_execute/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/corporate.png differ diff --git a/psql_query_execute/static/description/assets/misc/customer-support.png b/psql_query_execute/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/customer-support.png differ diff --git a/psql_query_execute/static/description/assets/misc/cybrosys-logo.png b/psql_query_execute/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/cybrosys-logo.png differ diff --git a/psql_query_execute/static/description/assets/misc/email.svg b/psql_query_execute/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/psql_query_execute/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/psql_query_execute/static/description/assets/misc/features.png b/psql_query_execute/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/features.png differ diff --git a/psql_query_execute/static/description/assets/misc/logo.png b/psql_query_execute/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/logo.png differ diff --git a/psql_query_execute/static/description/assets/misc/phone.svg b/psql_query_execute/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/psql_query_execute/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/psql_query_execute/static/description/assets/misc/pictures.png b/psql_query_execute/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/pictures.png differ diff --git a/psql_query_execute/static/description/assets/misc/pie-chart.png b/psql_query_execute/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/pie-chart.png differ diff --git a/psql_query_execute/static/description/assets/misc/right-arrow.png b/psql_query_execute/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/right-arrow.png differ diff --git a/psql_query_execute/static/description/assets/misc/star (1) 2.svg b/psql_query_execute/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/psql_query_execute/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/psql_query_execute/static/description/assets/misc/star.png b/psql_query_execute/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/star.png differ diff --git a/psql_query_execute/static/description/assets/misc/support (1) 1.svg b/psql_query_execute/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/psql_query_execute/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/psql_query_execute/static/description/assets/misc/support-email.svg b/psql_query_execute/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/psql_query_execute/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/psql_query_execute/static/description/assets/misc/support.png b/psql_query_execute/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/support.png differ diff --git a/psql_query_execute/static/description/assets/misc/tick-mark.svg b/psql_query_execute/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/psql_query_execute/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/psql_query_execute/static/description/assets/misc/whatsapp 1.svg b/psql_query_execute/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/psql_query_execute/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/psql_query_execute/static/description/assets/misc/whatsapp.png b/psql_query_execute/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/psql_query_execute/static/description/assets/misc/whatsapp.png differ diff --git a/psql_query_execute/static/description/assets/misc/whatsapp.svg b/psql_query_execute/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/psql_query_execute/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/psql_query_execute/static/description/assets/modules/1.png b/psql_query_execute/static/description/assets/modules/1.png new file mode 100644 index 000000000..ba1058c42 Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/1.png differ diff --git a/psql_query_execute/static/description/assets/modules/2.png b/psql_query_execute/static/description/assets/modules/2.png new file mode 100644 index 000000000..6949185dd Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/2.png differ diff --git a/psql_query_execute/static/description/assets/modules/3.png b/psql_query_execute/static/description/assets/modules/3.png new file mode 100644 index 000000000..4e506f79b Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/3.png differ diff --git a/psql_query_execute/static/description/assets/modules/4.png b/psql_query_execute/static/description/assets/modules/4.png new file mode 100644 index 000000000..e78427938 Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/4.png differ diff --git a/psql_query_execute/static/description/assets/modules/5.gif b/psql_query_execute/static/description/assets/modules/5.gif new file mode 100644 index 000000000..2a5f8e659 Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/5.gif differ diff --git a/psql_query_execute/static/description/assets/modules/5.png b/psql_query_execute/static/description/assets/modules/5.png new file mode 100755 index 000000000..272ec20f9 Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/5.png differ diff --git a/psql_query_execute/static/description/assets/modules/6.png b/psql_query_execute/static/description/assets/modules/6.png new file mode 100644 index 000000000..7d5c3154f Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/6.png differ diff --git a/psql_query_execute/static/description/assets/modules/l2.png b/psql_query_execute/static/description/assets/modules/l2.png new file mode 100644 index 000000000..f40a0756d Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/l2.png differ diff --git a/psql_query_execute/static/description/assets/modules/l3.png b/psql_query_execute/static/description/assets/modules/l3.png new file mode 100644 index 000000000..5738a486e Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/l3.png differ diff --git a/psql_query_execute/static/description/assets/modules/l4.png b/psql_query_execute/static/description/assets/modules/l4.png new file mode 100644 index 000000000..8d99e8c68 Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/l4.png differ diff --git a/psql_query_execute/static/description/assets/modules/l5.png b/psql_query_execute/static/description/assets/modules/l5.png new file mode 100644 index 000000000..3415917c2 Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/l5.png differ diff --git a/psql_query_execute/static/description/assets/modules/l6.png b/psql_query_execute/static/description/assets/modules/l6.png new file mode 100644 index 000000000..c7ea331ee Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/l6.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/hero.gif b/psql_query_execute/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..573afccb7 Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/hero.gif differ diff --git a/psql_query_execute/static/description/assets/screenshots/screenshot1.png b/psql_query_execute/static/description/assets/screenshots/screenshot1.png new file mode 100644 index 000000000..ccd10b589 Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/screenshot1.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/screenshot2.png b/psql_query_execute/static/description/assets/screenshots/screenshot2.png new file mode 100644 index 000000000..767f76d18 Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/screenshot2.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/screenshot3.png b/psql_query_execute/static/description/assets/screenshots/screenshot3.png new file mode 100644 index 000000000..05a986167 Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/screenshot3.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/screenshot4.png b/psql_query_execute/static/description/assets/screenshots/screenshot4.png new file mode 100644 index 000000000..fa556f6f6 Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/screenshot4.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/screenshot5.png b/psql_query_execute/static/description/assets/screenshots/screenshot5.png new file mode 100644 index 000000000..e9436806d Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/screenshot5.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/screenshot6.png b/psql_query_execute/static/description/assets/screenshots/screenshot6.png new file mode 100644 index 000000000..5ef086dce Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/screenshot6.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/screenshot7.png b/psql_query_execute/static/description/assets/screenshots/screenshot7.png new file mode 100644 index 000000000..40fbf1faa Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/screenshot7.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/screenshot8.png b/psql_query_execute/static/description/assets/screenshots/screenshot8.png new file mode 100644 index 000000000..c4e037e2a Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/screenshot8.png differ diff --git a/psql_query_execute/static/description/banner.jpg b/psql_query_execute/static/description/banner.jpg new file mode 100644 index 000000000..0ac2ef20d Binary files /dev/null and b/psql_query_execute/static/description/banner.jpg differ diff --git a/psql_query_execute/static/description/icon.png b/psql_query_execute/static/description/icon.png new file mode 100644 index 000000000..55e538e64 Binary files /dev/null and b/psql_query_execute/static/description/icon.png differ diff --git a/psql_query_execute/static/description/index.html b/psql_query_execute/static/description/index.html new file mode 100644 index 000000000..9b2c9fe1e --- /dev/null +++ b/psql_query_execute/static/description/index.html @@ -0,0 +1,765 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ PSQL Query Execute

+

+ Run the PSQL query in the Odoo user interface

+ +
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Fetch Data Easily

+

This module + helps you execute a query directly in the Odoo + interface and could view the result there itself. +

+
+
+
+
+
+
+ +
+
+

+ Print XLXS Report

+

The fetched + output from the query can be print Excel. +

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

+ Go To Settings -> Technical -> PSQL + Query.

+
+
+
+
+
+
+ + +
+
+

+ Create New PostgreSQL Query

+
+
+
+
+
+
+ + +
+
+

+ Write the SQL query for you to execute.

+
+
+
+
+
+
+ + +
+
+

+ Execute/Refresh the Query.

+
+
+
+
+
+
+ + +
+
+

+ Result of the query.

+
+
+
+
+
+
+ + +
+
+

+ Print Result.

+
+
+
+
+
+
+ + +
+
+

+ Download Query Result.XLSX PSQL Result.

+
+
+
+
+
+
+ + +
+
+

+ Query Error.

+
+
+
+
+ +
+
+
    +
  • + Execute Query. + Execute and save the SQL query. +
  • +
  • + Print Result. + Print your query result in XLSX format. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on: 12th December 2023 +
+

+ + Initial Commit for PSQL Query Execute.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

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 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/psql_query_execute/static/src/js/action_manager.js b/psql_query_execute/static/src/js/action_manager.js new file mode 100644 index 000000000..568a4c4b6 --- /dev/null +++ b/psql_query_execute/static/src/js/action_manager.js @@ -0,0 +1,18 @@ +/** @odoo-module **/ +import { registry } from "@web/core/registry"; +import { BlockUI } from "@web/core/ui/block_ui"; +import { download } from "@web/core/network/download"; +//this is used to call the controller and also passes the report data. +registry.category("ir.actions.report handlers").add("xlsx", async function (action) { + if (action.report_type === 'xlsx') { + BlockUI; + var def = $.Deferred(); + await download({ + url: '/xlsx_reports', + data: action.data, + success: def.resolve.bind(def), + error: (error) => this.call('crash_manager', 'rpc_error', error), + complete: () => unblockUI, + }); + } +}); diff --git a/psql_query_execute/views/psql_query_views.xml b/psql_query_execute/views/psql_query_views.xml new file mode 100644 index 000000000..df36758ab --- /dev/null +++ b/psql_query_execute/views/psql_query_views.xml @@ -0,0 +1,71 @@ + + + + + psql.query.view.form + psql.query + +
+ +
+

+ +

+
+ +

+ +

+
+
+
Result:
+
+ + + +
+ +
+
+
+
+ + + +
+
+
+
+ + + psql.query.view.tree + psql.query + + + + + + + + + + PostgreSQL Query + ir.actions.act_window + psql.query + tree,form + +

+ Execute PSQL Query +

+
+
+ + +