diff --git a/psql_query_execute/README.rst b/psql_query_execute/README.rst new file mode 100755 index 000000000..d9a1c237b --- /dev/null +++ b/psql_query_execute/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: http://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. + +Installation +============ + - www.odoo.com/documentation/16.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/16.0/legal/licenses/licenses.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer:(V16) Gion Dany + +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..f644ac3ea --- /dev/null +++ b/psql_query_execute/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +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..1e33cdd3c --- /dev/null +++ b/psql_query_execute/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "PSQL Query Execute", + 'version': '16.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """Run the PSQL query in the Odoo user interface.""", + 'description': """This module helps you execute a query directly + in the Odoo interface and output your query in Excel.""", + '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.png'], + '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..d742c72a8 --- /dev/null +++ b/psql_query_execute/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +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..72a113682 --- /dev/null +++ b/psql_query_execute/controllers/psql_query_execute.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +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..9a9681dd1 --- /dev/null +++ b/psql_query_execute/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 10.07.2023 +#### Version 16.0.1.0.0 +#### ADD +- Initial commit for PSQL Query Execute \ No newline at end of file diff --git a/psql_query_execute/models/__init__.py b/psql_query_execute/models/__init__.py new file mode 100644 index 000000000..3a5005928 --- /dev/null +++ b/psql_query_execute/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +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..39ea465a9 --- /dev/null +++ b/psql_query_execute/models/psql_query.py @@ -0,0 +1,144 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +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/logo.png b/psql_query_execute/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/psql_query_execute/static/description/assets/icons/logo.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/modules/module01.png b/psql_query_execute/static/description/assets/modules/module01.png new file mode 100644 index 000000000..a9936f593 Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/module01.png differ diff --git a/psql_query_execute/static/description/assets/modules/module02.png b/psql_query_execute/static/description/assets/modules/module02.png new file mode 100644 index 000000000..1a9e2cbd7 Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/module02.png differ diff --git a/psql_query_execute/static/description/assets/modules/module03.png b/psql_query_execute/static/description/assets/modules/module03.png new file mode 100644 index 000000000..d3d28e08b Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/module03.png differ diff --git a/psql_query_execute/static/description/assets/modules/module04.png b/psql_query_execute/static/description/assets/modules/module04.png new file mode 100644 index 000000000..5297b364a Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/module04.png differ diff --git a/psql_query_execute/static/description/assets/modules/module05.png b/psql_query_execute/static/description/assets/modules/module05.png new file mode 100644 index 000000000..2263f673e Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/module05.png differ diff --git a/psql_query_execute/static/description/assets/modules/module06.png b/psql_query_execute/static/description/assets/modules/module06.png new file mode 100644 index 000000000..0b8c68699 Binary files /dev/null and b/psql_query_execute/static/description/assets/modules/module06.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..2f117c6aa 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/psql_1.png b/psql_query_execute/static/description/assets/screenshots/psql_1.png new file mode 100644 index 000000000..f0a2cabc7 Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/psql_1.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/psql_2.png b/psql_query_execute/static/description/assets/screenshots/psql_2.png new file mode 100644 index 000000000..75c1dc910 Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/psql_2.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/psql_3.png b/psql_query_execute/static/description/assets/screenshots/psql_3.png new file mode 100644 index 000000000..e2703fd6a Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/psql_3.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/psql_4.png b/psql_query_execute/static/description/assets/screenshots/psql_4.png new file mode 100644 index 000000000..b99724b99 Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/psql_4.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/psql_5.png b/psql_query_execute/static/description/assets/screenshots/psql_5.png new file mode 100644 index 000000000..5772e8e5e Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/psql_5.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/psql_6.png b/psql_query_execute/static/description/assets/screenshots/psql_6.png new file mode 100644 index 000000000..df5af9830 Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/psql_6.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/psql_7.png b/psql_query_execute/static/description/assets/screenshots/psql_7.png new file mode 100644 index 000000000..67251ced0 Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/psql_7.png differ diff --git a/psql_query_execute/static/description/assets/screenshots/psql_8.png b/psql_query_execute/static/description/assets/screenshots/psql_8.png new file mode 100644 index 000000000..95b4a513b Binary files /dev/null and b/psql_query_execute/static/description/assets/screenshots/psql_8.png differ diff --git a/psql_query_execute/static/description/banner.png b/psql_query_execute/static/description/banner.png new file mode 100644 index 000000000..84b5fb732 Binary files /dev/null and b/psql_query_execute/static/description/banner.png 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..8e25065c8 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..2d7a623ab --- /dev/null +++ b/psql_query_execute/static/description/index.html @@ -0,0 +1,664 @@ +
+ + +
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+
+
+
+ + + +
+
+
+

+ PSQL Query Execute

+

+ Run the PSQL query in the Odoo user interface +

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

+ Overview +

+
+ +
+

+ This module helps you execute a query directly in the Odoo interface and output your query in Excel. +

+ +
+
+ + + +
+
+

+ Configuration +

+
+ +
+

+ No additional configuration required.

+ +
+
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Execute Query.

+

+ Execute and save the SQL query.

+
+
+ +
+
+ +
+
+

+ Print Result.

+

+ Print your query result in XLSX format.

+
+
+ + +
+ + + +
+
+

+ Screenshots +

+
+
+

+ Execute PSQL Query.

+
+
+

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

+ +
+
+

+ Query Error.

+ +
+
+

+ Print Result.

+
+
+

+ Download Query Result.

+ +
+
+

+ XLSX PSQL Result.

+ +
+
+ + + +
+
+

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/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..8d7b7581d --- /dev/null +++ b/psql_query_execute/static/src/js/action_manager.js @@ -0,0 +1,24 @@ +/** @odoo-module */ +import { registry } from "@web/core/registry"; +import { download } from "@web/core/network/download"; +import framework from 'web.framework'; +import session from 'web.session'; + +/** + * @override + * Add 'xlsx' report type to the report handler + */ +registry.category("ir.actions.report handlers").add("xlsx", async (action) => { + if (action.report_type === 'xlsx') { + framework.blockUI(); + var def = $.Deferred(); + session.get_file({ + url: '/xlsx_reports', + data: action.data, + success: def.resolve.bind(def), + error: (error) => this.call('crash_manager', 'rpc_error', error), + complete: framework.unblockUI, + }); + return def; + } +}); 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 +

+
+
+ + +