diff --git a/survey_export_xlsx/README.rst b/survey_export_xlsx/README.rst new file mode 100644 index 000000000..bdd7827d4 --- /dev/null +++ b/survey_export_xlsx/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Survey XLSX Report +================== +This module helps to export survey answers in XLSX format. + +Configuration +============= +* Nothing to configure. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Lesser General Public License, Version 3 (LGPL v3) +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developer: (V16) Albin P J, + (V15) Aysha Shalin, + 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/survey_export_xlsx/__init__.py b/survey_export_xlsx/__init__.py new file mode 100644 index 000000000..3f5cefe28 --- /dev/null +++ b/survey_export_xlsx/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# 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 +from . import wizard diff --git a/survey_export_xlsx/__manifest__.py b/survey_export_xlsx/__manifest__.py new file mode 100644 index 000000000..4633cbfa7 --- /dev/null +++ b/survey_export_xlsx/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# 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': 'Survey XLSX Report', + 'version': '15.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """This module helps to export survey answers in XLS format.""", + 'description': """This module helps to export survey answers in XLS format. + You can easily print the questions and answers of the corresponding user.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'survey', 'contacts'], + 'data': [ + 'security/ir.model.access.csv', + 'data/ir_action_data.xml', + 'wizard/survey_xlsx_report_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'survey_export_xlsx/static/src/js/action_manager.js'] + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/survey_export_xlsx/controllers/__init__.py b/survey_export_xlsx/controllers/__init__.py new file mode 100644 index 000000000..291dc0b42 --- /dev/null +++ b/survey_export_xlsx/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# 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 survey_export_xlsx diff --git a/survey_export_xlsx/controllers/survey_export_xlsx.py b/survey_export_xlsx/controllers/survey_export_xlsx.py new file mode 100644 index 000000000..130112933 --- /dev/null +++ b/survey_export_xlsx/controllers/survey_export_xlsx.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# 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 SurveyXlsReportController(http.Controller): + """ This is used for get the xlsx report """ + @http.route('/survey_xlsx_reports', type='http', auth='user', + methods=['POST'], csrf=False) + def get_report_xlsx(self, model, options, output_format, report_name): + """ Fetch the values from the survey_xlsx_reports """ + uid = request.session.uid + report_obj = request.env[model].with_user(uid) + options = json.loads(options) + 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/survey_export_xlsx/data/ir_action_data.xml b/survey_export_xlsx/data/ir_action_data.xml new file mode 100644 index 000000000..f2f7dfdc7 --- /dev/null +++ b/survey_export_xlsx/data/ir_action_data.xml @@ -0,0 +1,15 @@ + + + + + + Survey XLSX Report + + + code + + action = records.action_print_xlsx_report() + + + + diff --git a/survey_export_xlsx/doc/RELEASE_NOTES.md b/survey_export_xlsx/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..3a680e7c7 --- /dev/null +++ b/survey_export_xlsx/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 07.06.2024 +#### Version 15.0.1.0.0 +##### ADD +- Initial commit for Survey XLSX Report diff --git a/survey_export_xlsx/models/__init__.py b/survey_export_xlsx/models/__init__.py new file mode 100644 index 000000000..9aed0e60f --- /dev/null +++ b/survey_export_xlsx/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# 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 survey_survey diff --git a/survey_export_xlsx/models/survey_survey.py b/survey_export_xlsx/models/survey_survey.py new file mode 100644 index 000000000..662afceb9 --- /dev/null +++ b/survey_export_xlsx/models/survey_survey.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# 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 odoo import models + + +class Survey(models.Model): + """ Wizard for filter """ + _inherit = 'survey.survey' + + def action_print_xlsx_report(self): + """ Returning the wizard for filtering the report """ + return { + 'name': 'Survey Answer XLSX Report', + 'res_model': 'survey.xlsx.report', + 'view_mode': 'form', + 'view_type': 'form', + 'type': 'ir.actions.act_window', + 'target': 'new', + 'context': {'default_survey_ids': self.ids}, + } diff --git a/survey_export_xlsx/security/ir.model.access.csv b/survey_export_xlsx/security/ir.model.access.csv new file mode 100644 index 000000000..961c3e40c --- /dev/null +++ b/survey_export_xlsx/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_survey_xlsx_report_user,access.survey.xlsx.report.user,model_survey_xlsx_report,base.group_user,1,1,1,1 diff --git a/survey_export_xlsx/static/description/assets/icons/check.png b/survey_export_xlsx/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/check.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/chevron.png b/survey_export_xlsx/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/chevron.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/cogs.png b/survey_export_xlsx/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/cogs.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/consultation.png b/survey_export_xlsx/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/consultation.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/ecom-black.png b/survey_export_xlsx/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/ecom-black.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/education-black.png b/survey_export_xlsx/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/education-black.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/hotel-black.png b/survey_export_xlsx/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/hotel-black.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/license.png b/survey_export_xlsx/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/license.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/lifebuoy.png b/survey_export_xlsx/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/lifebuoy.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/manufacturing-black.png b/survey_export_xlsx/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/manufacturing-black.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/pos-black.png b/survey_export_xlsx/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/pos-black.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/puzzle.png b/survey_export_xlsx/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/puzzle.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/restaurant-black.png b/survey_export_xlsx/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/restaurant-black.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/service-black.png b/survey_export_xlsx/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/service-black.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/trading-black.png b/survey_export_xlsx/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/trading-black.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/training.png b/survey_export_xlsx/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/training.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/update.png b/survey_export_xlsx/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/update.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/user.png b/survey_export_xlsx/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/user.png differ diff --git a/survey_export_xlsx/static/description/assets/icons/wrench.png b/survey_export_xlsx/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/survey_export_xlsx/static/description/assets/icons/wrench.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/categories.png b/survey_export_xlsx/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/categories.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/check-box.png b/survey_export_xlsx/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/check-box.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/compass.png b/survey_export_xlsx/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/compass.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/corporate.png b/survey_export_xlsx/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/corporate.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/customer-support.png b/survey_export_xlsx/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/customer-support.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/cybrosys-logo.png b/survey_export_xlsx/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/cybrosys-logo.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/features.png b/survey_export_xlsx/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/features.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/logo.png b/survey_export_xlsx/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/logo.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/pictures.png b/survey_export_xlsx/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/pictures.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/pie-chart.png b/survey_export_xlsx/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/pie-chart.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/right-arrow.png b/survey_export_xlsx/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/right-arrow.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/star.png b/survey_export_xlsx/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/star.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/support.png b/survey_export_xlsx/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/support.png differ diff --git a/survey_export_xlsx/static/description/assets/misc/whatsapp.png b/survey_export_xlsx/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/misc/whatsapp.png differ diff --git a/survey_export_xlsx/static/description/assets/modules/customer_product_qrcode.png b/survey_export_xlsx/static/description/assets/modules/customer_product_qrcode.png new file mode 100644 index 000000000..71e2150bb Binary files /dev/null and b/survey_export_xlsx/static/description/assets/modules/customer_product_qrcode.png differ diff --git a/survey_export_xlsx/static/description/assets/modules/customized_barcode_generator.png b/survey_export_xlsx/static/description/assets/modules/customized_barcode_generator.png new file mode 100644 index 000000000..e678cb13b Binary files /dev/null and b/survey_export_xlsx/static/description/assets/modules/customized_barcode_generator.png differ diff --git a/survey_export_xlsx/static/description/assets/modules/employee_dynamic_fields.png b/survey_export_xlsx/static/description/assets/modules/employee_dynamic_fields.png new file mode 100644 index 000000000..036bc94b5 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/modules/employee_dynamic_fields.png differ diff --git a/survey_export_xlsx/static/description/assets/modules/list_view_sticky_header.png b/survey_export_xlsx/static/description/assets/modules/list_view_sticky_header.png new file mode 100644 index 000000000..8c155b2ee Binary files /dev/null and b/survey_export_xlsx/static/description/assets/modules/list_view_sticky_header.png differ diff --git a/survey_export_xlsx/static/description/assets/modules/odoo_website_helpdesk.png b/survey_export_xlsx/static/description/assets/modules/odoo_website_helpdesk.png new file mode 100644 index 000000000..d4a493e9c Binary files /dev/null and b/survey_export_xlsx/static/description/assets/modules/odoo_website_helpdesk.png differ diff --git a/survey_export_xlsx/static/description/assets/modules/todo_list.png b/survey_export_xlsx/static/description/assets/modules/todo_list.png new file mode 100644 index 000000000..e4d1f254a Binary files /dev/null and b/survey_export_xlsx/static/description/assets/modules/todo_list.png differ diff --git a/survey_export_xlsx/static/description/assets/screenshots/1.png b/survey_export_xlsx/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..80084b839 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/screenshots/1.png differ diff --git a/survey_export_xlsx/static/description/assets/screenshots/2.png b/survey_export_xlsx/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..5b7373775 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/screenshots/2.png differ diff --git a/survey_export_xlsx/static/description/assets/screenshots/3.png b/survey_export_xlsx/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..ab2003017 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/screenshots/3.png differ diff --git a/survey_export_xlsx/static/description/assets/screenshots/4.png b/survey_export_xlsx/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..34b3c0a37 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/screenshots/4.png differ diff --git a/survey_export_xlsx/static/description/assets/screenshots/hero.gif b/survey_export_xlsx/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..474060a12 Binary files /dev/null and b/survey_export_xlsx/static/description/assets/screenshots/hero.gif differ diff --git a/survey_export_xlsx/static/description/banner.png b/survey_export_xlsx/static/description/banner.png new file mode 100644 index 000000000..e4bd8929e Binary files /dev/null and b/survey_export_xlsx/static/description/banner.png differ diff --git a/survey_export_xlsx/static/description/icon.png b/survey_export_xlsx/static/description/icon.png new file mode 100644 index 000000000..7a416a345 Binary files /dev/null and b/survey_export_xlsx/static/description/icon.png differ diff --git a/survey_export_xlsx/static/description/index.html b/survey_export_xlsx/static/description/index.html new file mode 100644 index 000000000..a0fcf0353 --- /dev/null +++ b/survey_export_xlsx/static/description/index.html @@ -0,0 +1,568 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Survey XLSX Report +

+

This Module Helps to Export Survey Answers in XLSX Format. + You can Easily Print the Questions and Answers of the + Corresponding User.

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This module helps to Export Survey Answers in XLSX format.You can easily get the Questions and Answers of the Corresponding User, and it Saves Your Important Time. +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + You can Filter the Survey Questions and Answers based on User. +
+
+ + You can get Questions and Answers in Tree/Form views. +
+
+ + Also, You can get Filtered Reports of all Survey Questions and Answers from the Tree view. +
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+
+

You can get Survey XLSX Report button in Tree/Form views.

+

Button In Tree View

+ +

Button In Form View

+ +
+ +
+

Get User Specific Report

+

You can see the option to add users. Also, you can add a user, and it will give a survey questions and answers based on the user.

+
+ +
+
+

Get All Users Report

+

If you haven't chosen any user, you will get survey questions and answers from all users.

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

+ 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/survey_export_xlsx/static/src/js/action_manager.js b/survey_export_xlsx/static/src/js/action_manager.js new file mode 100644 index 000000000..575329f65 --- /dev/null +++ b/survey_export_xlsx/static/src/js/action_manager.js @@ -0,0 +1,21 @@ +/** @odoo-module */ +// Import required modules from the Odoo web framework +import { registry } from "@web/core/registry"; +import framework from 'web.framework'; +import session from 'web.session'; + +// Register a handler for generating XLSX reports +registry.category("ir.actions.report handlers").add("xlsx", async (action) => { + if (action.report_type === 'xlsx') { + framework.blockUI(); + var def = $.Deferred(); + session.get_file({ + url: '/survey_xlsx_reports', + data: action.data, + success: def.resolve.bind(def), + error: (error) => this.call('crash_manager', 'rpc_error', error), + complete: framework.unblockUI, + }); + return def; + } +}) \ No newline at end of file diff --git a/survey_export_xlsx/wizard/__init__.py b/survey_export_xlsx/wizard/__init__.py new file mode 100644 index 000000000..2cb5154d7 --- /dev/null +++ b/survey_export_xlsx/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# 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 survey_xlsx_report diff --git a/survey_export_xlsx/wizard/survey_xlsx_report.py b/survey_export_xlsx/wizard/survey_xlsx_report.py new file mode 100644 index 000000000..d72de9544 --- /dev/null +++ b/survey_export_xlsx/wizard/survey_xlsx_report.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# 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 io +import xlsxwriter +from odoo import _, api, fields, models +from odoo.tools import date_utils +from odoo.tools.safe_eval import json +from odoo.exceptions import ValidationError + + +class SurveyXlsReport(models.TransientModel): + """ This is the wizard model, We can filter the xls report using this + model. """ + _name = 'survey.xlsx.report' + _description = 'Survey XLSX Report ' + + partner_id = fields.Many2one( + 'res.partner', string="Partner", + help="Select for getting the report of the user") + survey_ids = fields.Many2many( + 'survey.survey', string="Survey Ids", + help="This field stores survey ids", readonly=True) + + @api.onchange('partner_id') + def _onchange_partner_id(self): + """ This will only return the corresponding users in the survey """ + partner_ids = [] + for rec in self.survey_ids: + user_list = self.env['survey.user_input'].search( + [('survey_id', '=', rec._origin.id), ('state', '=', 'done')]) + for dec in user_list.partner_id: + if dec.id not in partner_ids: + partner_ids.append(dec.id) + if not partner_ids: + raise ValidationError(_( + "There are no partners participating in this survey")) + + return {'domain': {'partner_id': [('id', 'in', partner_ids)]}} + + def action_print_survey_xlsx_report(self): + """ Call from button, It will print the xlsx report """ + data_dict = {} + for doc in self.survey_ids: + domain = [('survey_id', '=', doc.id), ('state', '=', 'done')] + if self.partner_id: + domain.append(('partner_id', '=', self.partner_id.id)) + for record in self.env['survey.user_input'].search(domain): + for rec in self.env['survey.user_input.line'].search( + [('user_input_id', '=', record.id)]): + data = { + 'survey_name': rec.survey_id.title, + 'create_date': rec.create_date, + 'user_name': rec.user_input_id.partner_id.name, + 'question': rec.question_id.title, + 'answer': rec.display_name, + } + # Check if the survey_name is already in the dictionary + survey_name = data['survey_name'] + if survey_name not in data_dict: + data_dict[ + survey_name] = [] + data_dict[survey_name].append(data) + grouped_data_list = [ + {'survey_name': survey_name, 'partner_id': self.partner_id.name, + 'data': survey_data} for survey_name, survey_data in + data_dict.items()] + dict_data = { + 'record': grouped_data_list + } + return { + 'type': 'ir.actions.report', + 'data': { + 'model': 'survey.xlsx.report', + 'options': json.dumps(dict_data, + default=date_utils.json_default), + 'output_format': 'xlsx', + 'report_name': 'Survey Question Answer Report', + }, + 'report_type': 'xlsx', + } + + def get_xlsx_report(self, dict_data, response): + """ This function will get the xlsx report """ + output = io.BytesIO() + workbook = xlsxwriter.Workbook(output, {'in_memory': True}) + sheet = workbook.add_worksheet() + format21 = workbook.add_format({'font_size': 10, 'bold': True}) + font_size_8 = workbook.add_format({'font_size': 8}) + head = workbook.add_format( + {'align': 'center', 'bold': True, 'font_size': '20px'}) + heading_row_height = 30 + if dict_data.get('record'): + if dict_data['record']: + row = 0 + for records in dict_data.get('record'): + sheet.write(row, 0, records['survey_name'], head) + sheet.set_row(sheet.dim_rowmax, heading_row_height) + sheet.merge_range(sheet.dim_rowmax, 0, sheet.dim_rowmax, 4, + records['survey_name'], + head) + row += 1 + if not records.get('partner_id'): + sheet.set_column('A:A', 5) + sheet.set_column('B:B', 15) + sheet.set_column('C:C', 15) + sheet.set_column('D:D', 76) + sheet.set_column('E:E', 56) + sheet.write(row, 0, 'Sl no', format21) + sheet.write(row, 1, 'Name', format21) + sheet.write(row, 2, 'Date', format21) + sheet.write(row, 3, 'Question', format21) + sheet.write(row, 4, 'Answer', format21) + row += 1 + a = 1 + for datas in records.get('data'): + sheet.write(row, 0, a, font_size_8) + a = a + 1 + sheet.write(row, 1, datas.get('user_name'), + font_size_8) + sheet.write(row, 2, datas.get('create_date'), + font_size_8) + sheet.write(row, 3, datas.get('question'), + font_size_8) + sheet.write(row, 4, datas.get('answer'), + font_size_8) + row += 1 + else: + sheet.set_column('A:A', 5) + sheet.set_column('B:B', 15) + sheet.set_column('C:C', 76) + sheet.set_column('D:D', 56) + sheet.write(row, 0, 'Sl no', format21) + sheet.write(row, 1, 'Date', format21) + sheet.write(row, 2, 'Question', format21) + sheet.write(row, 3, 'Answer', format21) + row += 1 + a = 1 + for datas in records.get('data'): + sheet.write(row, 0, a, font_size_8) + a = a + 1 + sheet.write(row, 1, datas.get('create_date'), + font_size_8) + sheet.write(row, 2, datas.get('question'), + font_size_8) + sheet.write(row, 3, datas.get('answer'), + font_size_8) + row += 1 + workbook.close() + output.seek(0) + response.stream.write(output.read()) + output.close() diff --git a/survey_export_xlsx/wizard/survey_xlsx_report_views.xml b/survey_export_xlsx/wizard/survey_xlsx_report_views.xml new file mode 100644 index 000000000..9e7e36e01 --- /dev/null +++ b/survey_export_xlsx/wizard/survey_xlsx_report_views.xml @@ -0,0 +1,27 @@ + + + + + survey.xlsx.report.view.form + survey.xlsx.report + +
+ + + + + + + +
+
+
+