diff --git a/survey_upload_file/README.rst b/survey_upload_file/README.rst new file mode 100644 index 000000000..1d4657096 --- /dev/null +++ b/survey_upload_file/README.rst @@ -0,0 +1,42 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +File Upload In Survey +===================== +This module is used for attachment of files in Survey Form + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (V16) Anfas Faisal K@ Cybrosys, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/survey_upload_file/__init__.py b/survey_upload_file/__init__.py new file mode 100644 index 000000000..f03fb2c25 --- /dev/null +++ b/survey_upload_file/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Anfas Faisal K (odoo@cybrosys.info) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import models diff --git a/survey_upload_file/__manifest__.py b/survey_upload_file/__manifest__.py new file mode 100644 index 000000000..a236677ce --- /dev/null +++ b/survey_upload_file/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Anfas Faisal K (odoo@cybrosys.info) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': "File Upload In Survey", + 'version': "16.0.1.0.0", + 'category': 'Extra Tools', + 'summary': 'Attachment of File in Survey Form', + 'description': 'This module is used for attachments of file in Survey Form,' + 'You can also add multiple file attachment to Survey Form .', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['survey'], + 'assets': { + 'web.assets_frontend': [ + 'survey_upload_file/static/src/js/survey_form_attachment.js', + ], + }, + 'data': [ + 'views/survey_question_views.xml', + 'views/survey_user_views.xml', + 'views/survey_templates.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/survey_upload_file/doc/RELEASE_NOTES.md b/survey_upload_file/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..075bd72a1 --- /dev/null +++ b/survey_upload_file/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 15.12.2023 +#### Version 16.0.1.0.0 +#### ADD + +- Initial Commit for File Upload In Survey diff --git a/survey_upload_file/models/__init__.py b/survey_upload_file/models/__init__.py new file mode 100644 index 000000000..3d8054293 --- /dev/null +++ b/survey_upload_file/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Anfas Faisal K (odoo@cybrosys.info) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import survey_question +from . import survey_user_input_line +from . import survey_user_input diff --git a/survey_upload_file/models/survey_question.py b/survey_upload_file/models/survey_question.py new file mode 100644 index 000000000..436dcd14d --- /dev/null +++ b/survey_upload_file/models/survey_question.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Anfas Faisal K (odoo@cybrosys.info) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import fields, models + + +class SurveyQuestion(models.Model): + """ + This class extends the 'survey.question' model to add new functionality + for file uploads. + """ + _inherit = 'survey.question' + + question_type = fields.Selection( + selection_add=[('upload_file', 'Upload File')], + help='Select the type of question to create.') + upload_multiple_file = fields.Boolean(string='Upload Multiple File', + help='Check this box if you want to ' + 'allow users to upload ' + 'multiple files') diff --git a/survey_upload_file/models/survey_user_input.py b/survey_upload_file/models/survey_user_input.py new file mode 100644 index 000000000..1bbfad090 --- /dev/null +++ b/survey_upload_file/models/survey_user_input.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Anfas Faisal K (odoo@cybrosys.info) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import models + + +class SurveyUserInput(models.Model): + """ + This class extends the 'survey.user_input' model to add custom + functionality for saving user answers. + + Methods: + save_lines: Save the user's answer for the given question + _save_line_file:Save the user's file upload answer for the given + question + _get_line_answer_file_upload_values: + Get the values to use when creating or updating a user input line + for a file upload answer + """ + _inherit = "survey.user_input" + + def save_lines(self, question, answer, comment=None): + """Save the user's answer for the given question.""" + old_answers = self.env['survey.user_input.line'].search([ + ('user_input_id', '=', self.id), + ('question_id', '=', question.id), ]) + if question.question_type in 'upload_file': + res = self._save_line_file(question, old_answers, answer) + else: + res = super().save_lines(question, answer, comment) + return res + + def _save_line_file(self, question, old_answers, answer): + """ Save the user's file upload answer for the given question.""" + vals = self._get_line_answer_file_upload_values(question, + 'upload_file', answer) + if old_answers: + old_answers.write(vals) + return old_answers + else: + return self.env['survey.user_input.line'].create(vals) + + def _get_line_answer_file_upload_values(self, question, answer_type, + answer): + """Get the values to use when creating or updating a user input line + for a file upload answer.""" + vals = { + 'user_input_id': self.id, + 'question_id': question.id, + 'skipped': False, + 'answer_type': answer_type, + } + if answer_type == 'upload_file': + file_data = answer[0] + file_name = answer[1] + attachment_ids = [] + for file in range(len(answer[1])): + attachment = self.env['ir.attachment'].create({ + 'name': file_name[file], + 'type': 'binary', + 'datas': file_data[file], + }) + attachment_ids.append(attachment.id) + vals['value_file_data_ids'] = attachment_ids + return vals diff --git a/survey_upload_file/models/survey_user_input_line.py b/survey_upload_file/models/survey_user_input_line.py new file mode 100644 index 000000000..ab22e29a7 --- /dev/null +++ b/survey_upload_file/models/survey_user_input_line.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Anfas Faisal K (odoo@cybrosys.info) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import api, fields, models + + +class SurveyUserInputLine(models.Model): + """ + This class extends the 'survey.user_input.line' model to add additional + fields and constraints for file uploads. + Methods: + _check_answer_type_skipped:Check that a line's answer type is + not set to 'upload_file' if the line is skipped + """ + _inherit = "survey.user_input.line" + + answer_type = fields.Selection( + selection_add=[('upload_file', 'Upload File')], + help="The type of answer for this question (upload_file if the user " + "is uploading a file).") + value_file_data_ids = fields.Many2many('ir.attachment', + help="The attachments " + "corresponding to the user's " + "file upload answer, if any.") + + @api.constrains('skipped', 'answer_type') + def _check_answer_type_skipped(self): + """ Check that a line's answer type is not set to 'upload_file' if + the line is skipped.""" + for line in self: + if line.answer_type != 'upload_file': + super(SurveyUserInputLine, line)._check_answer_type_skipped() diff --git a/survey_upload_file/static/description/assets/icons/check.png b/survey_upload_file/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/check.png differ diff --git a/survey_upload_file/static/description/assets/icons/chevron.png b/survey_upload_file/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/chevron.png differ diff --git a/survey_upload_file/static/description/assets/icons/cogs.png b/survey_upload_file/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/cogs.png differ diff --git a/survey_upload_file/static/description/assets/icons/consultation.png b/survey_upload_file/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/consultation.png differ diff --git a/survey_upload_file/static/description/assets/icons/ecom-black.png b/survey_upload_file/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/ecom-black.png differ diff --git a/survey_upload_file/static/description/assets/icons/education-black.png b/survey_upload_file/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/education-black.png differ diff --git a/survey_upload_file/static/description/assets/icons/hotel-black.png b/survey_upload_file/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/hotel-black.png differ diff --git a/survey_upload_file/static/description/assets/icons/license.png b/survey_upload_file/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/license.png differ diff --git a/survey_upload_file/static/description/assets/icons/lifebuoy.png b/survey_upload_file/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/lifebuoy.png differ diff --git a/survey_upload_file/static/description/assets/icons/manufacturing-black.png b/survey_upload_file/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/manufacturing-black.png differ diff --git a/survey_upload_file/static/description/assets/icons/pos-black.png b/survey_upload_file/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/pos-black.png differ diff --git a/survey_upload_file/static/description/assets/icons/puzzle.png b/survey_upload_file/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/puzzle.png differ diff --git a/survey_upload_file/static/description/assets/icons/restaurant-black.png b/survey_upload_file/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/restaurant-black.png differ diff --git a/survey_upload_file/static/description/assets/icons/service-black.png b/survey_upload_file/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/service-black.png differ diff --git a/survey_upload_file/static/description/assets/icons/trading-black.png b/survey_upload_file/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/trading-black.png differ diff --git a/survey_upload_file/static/description/assets/icons/training.png b/survey_upload_file/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/training.png differ diff --git a/survey_upload_file/static/description/assets/icons/update.png b/survey_upload_file/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/update.png differ diff --git a/survey_upload_file/static/description/assets/icons/user.png b/survey_upload_file/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/user.png differ diff --git a/survey_upload_file/static/description/assets/icons/wrench.png b/survey_upload_file/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/wrench.png differ diff --git a/survey_upload_file/static/description/assets/misc/categories.png b/survey_upload_file/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/categories.png differ diff --git a/survey_upload_file/static/description/assets/misc/check-box.png b/survey_upload_file/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/check-box.png differ diff --git a/survey_upload_file/static/description/assets/misc/compass.png b/survey_upload_file/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/compass.png differ diff --git a/survey_upload_file/static/description/assets/misc/corporate.png b/survey_upload_file/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/corporate.png differ diff --git a/survey_upload_file/static/description/assets/misc/customer-support.png b/survey_upload_file/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/customer-support.png differ diff --git a/survey_upload_file/static/description/assets/misc/cybrosys-logo.png b/survey_upload_file/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/cybrosys-logo.png differ diff --git a/survey_upload_file/static/description/assets/misc/features.png b/survey_upload_file/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/features.png differ diff --git a/survey_upload_file/static/description/assets/misc/logo.png b/survey_upload_file/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/logo.png differ diff --git a/survey_upload_file/static/description/assets/misc/pictures.png b/survey_upload_file/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/pictures.png differ diff --git a/survey_upload_file/static/description/assets/misc/pie-chart.png b/survey_upload_file/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/pie-chart.png differ diff --git a/survey_upload_file/static/description/assets/misc/right-arrow.png b/survey_upload_file/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/right-arrow.png differ diff --git a/survey_upload_file/static/description/assets/misc/star.png b/survey_upload_file/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/star.png differ diff --git a/survey_upload_file/static/description/assets/misc/support.png b/survey_upload_file/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/support.png differ diff --git a/survey_upload_file/static/description/assets/misc/whatsapp.png b/survey_upload_file/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/survey_upload_file/static/description/assets/misc/whatsapp.png differ diff --git a/survey_upload_file/static/description/assets/modules/1.png b/survey_upload_file/static/description/assets/modules/1.png new file mode 100644 index 000000000..6cc0986f2 Binary files /dev/null and b/survey_upload_file/static/description/assets/modules/1.png differ diff --git a/survey_upload_file/static/description/assets/modules/2.png b/survey_upload_file/static/description/assets/modules/2.png new file mode 100644 index 000000000..7b0ac4b33 Binary files /dev/null and b/survey_upload_file/static/description/assets/modules/2.png differ diff --git a/survey_upload_file/static/description/assets/modules/3.png b/survey_upload_file/static/description/assets/modules/3.png new file mode 100644 index 000000000..ae32f480b Binary files /dev/null and b/survey_upload_file/static/description/assets/modules/3.png differ diff --git a/survey_upload_file/static/description/assets/modules/4.png b/survey_upload_file/static/description/assets/modules/4.png new file mode 100644 index 000000000..d9374733c Binary files /dev/null and b/survey_upload_file/static/description/assets/modules/4.png differ diff --git a/survey_upload_file/static/description/assets/modules/5.png b/survey_upload_file/static/description/assets/modules/5.png new file mode 100644 index 000000000..c3a620a56 Binary files /dev/null and b/survey_upload_file/static/description/assets/modules/5.png differ diff --git a/survey_upload_file/static/description/assets/modules/6.png b/survey_upload_file/static/description/assets/modules/6.png new file mode 100644 index 000000000..a29119785 Binary files /dev/null and b/survey_upload_file/static/description/assets/modules/6.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/1.png b/survey_upload_file/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..35bba4a55 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/1.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/2.png b/survey_upload_file/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..f325a8712 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/2.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/3.png b/survey_upload_file/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..95cae7e25 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/3.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/4.png b/survey_upload_file/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..c54225dab Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/4.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/5.png b/survey_upload_file/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..abc798acd Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/5.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/6.png b/survey_upload_file/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..145f9aff4 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/6.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/7.png b/survey_upload_file/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..7daf26a94 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/7.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/8.png b/survey_upload_file/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..27118252f Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/8.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/9.png b/survey_upload_file/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..12d412ecd Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/9.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/admin multiple upload question.png b/survey_upload_file/static/description/assets/screenshots/admin multiple upload question.png new file mode 100644 index 000000000..e6f718784 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/admin multiple upload question.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/admin view answer.png b/survey_upload_file/static/description/assets/screenshots/admin view answer.png new file mode 100644 index 000000000..054cc8556 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/admin view answer.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/answerview2.png b/survey_upload_file/static/description/assets/screenshots/answerview2.png new file mode 100644 index 000000000..f8bd99c01 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/answerview2.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/answeview parti.png b/survey_upload_file/static/description/assets/screenshots/answeview parti.png new file mode 100644 index 000000000..c57765f21 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/answeview parti.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/checklist pay.png b/survey_upload_file/static/description/assets/screenshots/checklist pay.png new file mode 100644 index 000000000..289c2486f Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/checklist pay.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/delefunction.png b/survey_upload_file/static/description/assets/screenshots/delefunction.png new file mode 100644 index 000000000..e157dff0f Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/delefunction.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/download from answer if they w..png b/survey_upload_file/static/description/assets/screenshots/download from answer if they w..png new file mode 100644 index 000000000..1861a0016 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/download from answer if they w..png differ diff --git a/survey_upload_file/static/description/assets/screenshots/download it here.png b/survey_upload_file/static/description/assets/screenshots/download it here.png new file mode 100644 index 000000000..3936c74c2 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/download it here.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/multi question.png b/survey_upload_file/static/description/assets/screenshots/multi question.png new file mode 100644 index 000000000..687ddaed6 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/multi question.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/mutiupload partic.png b/survey_upload_file/static/description/assets/screenshots/mutiupload partic.png new file mode 100644 index 000000000..920c6e3fa Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/mutiupload partic.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/no sales.png b/survey_upload_file/static/description/assets/screenshots/no sales.png new file mode 100644 index 000000000..cde407e7e Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/no sales.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/question downpoijdcoisd.png b/survey_upload_file/static/description/assets/screenshots/question downpoijdcoisd.png new file mode 100644 index 000000000..b15abece6 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/question downpoijdcoisd.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/question.single.png b/survey_upload_file/static/description/assets/screenshots/question.single.png new file mode 100644 index 000000000..67a3d44ba Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/question.single.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/questionsingle.view.png b/survey_upload_file/static/description/assets/screenshots/questionsingle.view.png new file mode 100644 index 000000000..bf83639f6 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/questionsingle.view.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/review test.png b/survey_upload_file/static/description/assets/screenshots/review test.png new file mode 100644 index 000000000..69818685b Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/review test.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/smartbutton to view quest.png b/survey_upload_file/static/description/assets/screenshots/smartbutton to view quest.png new file mode 100644 index 000000000..b6cce6f9d Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/smartbutton to view quest.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/suvey form view for single.png b/survey_upload_file/static/description/assets/screenshots/suvey form view for single.png new file mode 100644 index 000000000..0069500a1 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/suvey form view for single.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/united states country.png b/survey_upload_file/static/description/assets/screenshots/united states country.png new file mode 100644 index 000000000..444d3e4d7 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/united states country.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/v16-hero (1).gif b/survey_upload_file/static/description/assets/screenshots/v16-hero (1).gif new file mode 100644 index 000000000..6bff43557 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/v16-hero (1).gif differ diff --git a/survey_upload_file/static/description/assets/screenshots/vieq question.png b/survey_upload_file/static/description/assets/screenshots/vieq question.png new file mode 100644 index 000000000..2afae664d Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/vieq question.png differ diff --git a/survey_upload_file/static/description/banner.png b/survey_upload_file/static/description/banner.png new file mode 100644 index 000000000..038cf778d Binary files /dev/null and b/survey_upload_file/static/description/banner.png differ diff --git a/survey_upload_file/static/description/icon.png b/survey_upload_file/static/description/icon.png new file mode 100644 index 000000000..6fcbc46f2 Binary files /dev/null and b/survey_upload_file/static/description/icon.png differ diff --git a/survey_upload_file/static/description/index.html b/survey_upload_file/static/description/index.html new file mode 100644 index 000000000..0c17b6226 --- /dev/null +++ b/survey_upload_file/static/description/index.html @@ -0,0 +1,593 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+ +
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ File Upload In Survey +

+

File Upload In Survey Adds Single Or Multiple File Upload Options In Survey. +

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

Explore This Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ File Upload In Survey Odoo app adds single or multiple file upload options to surveys. Users can add questions to the survey that allow participants to upload files as answers. Participants can either choose to upload a single file or add multiple files in response to the survey question. Participants can view their uploaded attachments by clicking the "review your answers" button in the survey.
+
+ + +
+
+ +
+

Features +

+
+
+
+
+ + User can upload file for survey questions. +
+
+ + Upload single file as answer for survey questions or Upload multiple file as answer for survey questions. + +
+
+ +
+ + Participants can view their answer in the 'review your answers' button in Survey form. + +
+
+
+
+ + +
+
+ +
+

Screenshots +

+
+

Single Download attachments

+
+
+
+

On survey user can add questions as file upload type and allow user to add file as attachment answer. +

+ +
+
+

User can select "Upload File" as "Question Type", User can also see question type view icon for file upload. +

+ +
+
+

On survey participants can see "Choose file" options for "File Upload" question type, by clicking this button user can upload a file as attachment and also a note is shown so the Participant can know he can only upload one File. +

+ +
+ +
+

+ Once participants finish survey he/she can view attached file by clicking "review your answers" button. +

+ +
+
+

+ The Participant can view and download the attachments by clicking the File Name. +

+ +
+
+

+ User can see uploaded files on by clicking the smart button inside question form. +

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

+ The User can Download the Attachment of the Participant Here. +

+ +
+

Multiple Download attachments

+ +
+

+ On survey user can add questions as file upload type and allow survey participants to add multiple file as attachment answer. +

+ +
+ +
+

+ User can select "File Upload" as "Question Type", User also need to enable " Upload Multiple file" options only then survey participants can also see question type view icon for file upload.

+ +
+ +
+

+ On survey participants can see "Choose File" options for "File Upload" question type, by clicking this button user can select and upload multiple files as attachment and also a note is shown so the Participant can know he can upload multiple Files. +

+ +
+ +
+

+ On survey participants can see "Choose File" options for "File Upload" question type, by clicking this button user can select and upload multiple files as attachment and also a note is shown so the Participant can know he can upload multiple Files. +

+ +
+ + +
+

+ Once participants finish survey he/she can view all uploaded multiple file by clicking "review your answers" button and also download and view attachments by clicking file. +

+ +

+ The Participant can view and download the attachments by clicking the File Name. +

+ +
+ +
+

+ User can see uploaded files on answers. +

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

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_upload_file/static/src/js/survey_form_attachment.js b/survey_upload_file/static/src/js/survey_form_attachment.js new file mode 100644 index 000000000..01b80fbf3 --- /dev/null +++ b/survey_upload_file/static/src/js/survey_form_attachment.js @@ -0,0 +1,77 @@ +odoo.define('survey_upload_file', function (require) { + 'use strict'; + + var SurveyFormWidget = require('survey.form'); + var core = require('web.core'); + + SurveyFormWidget.include({ + events: _.extend({}, SurveyFormWidget.prototype.events,{ + 'change .o_survey_upload_file': '_onFileChange', + }), + + start: function () { + return this._super.apply(this, arguments) + }, + //On adding file function + _onFileChange: function(event) { + var self = this; + var files = event.target.files; + var fileNames = []; + var dataURLs = []; + for (let i = 0; i < files.length; i++) { + var reader = new FileReader(); + reader.readAsDataURL(files[i]); + + reader.onload = function(e) { + var file = files[i]; + var filename = file.name; + var dataURL = e.target.result.split(',')[1]; // split base64 data + fileNames.push(filename); + dataURLs.push(dataURL); + + // set the data-oe-data and data-oe-file_name attributes of the input element +// self call el + var $input = self.$el.find('input.o_survey_upload_file'); + $input.attr('data-oe-data', JSON.stringify(dataURLs)); + $input.attr('data-oe-file_name', JSON.stringify(fileNames)); + + // create file list elements + var fileList = document.getElementById('fileList'); + fileList.innerHTML = ''; // clear previous contents of file list + + var ul = document.createElement('ul'); + fileNames.forEach(function(fileName) { + var li = document.createElement('li'); + li.textContent = fileName; + ul.appendChild(li); + }); + + // create delete button + var deleteBtn = document.createElement('button'); + deleteBtn.textContent = 'Delete All'; + deleteBtn.addEventListener('click', function() { + // clear file list + fileList.innerHTML = ''; + // clear input field attributes + $input.attr('data-oe-data', ''); + $input.attr('data-oe-file_name', ''); + self.$el.find('input[type="file"]').val(''); + }); + + // append file list and delete button to file input container + fileList.appendChild(ul); + fileList.appendChild(deleteBtn); + } + } + }, + // Get all question answers by question type + _prepareSubmitValues: function (formData, params) { + this._super(formData, params) + this.$('[data-question-type]').each(function () { + if ($(this).data('questionType') === 'upload_file'){ + params[this.name] = [$(this).data('oe-data'), $(this).data('oe-file_name')]; + } + }); + }, + }); + }); diff --git a/survey_upload_file/views/survey_question_views.xml b/survey_upload_file/views/survey_question_views.xml new file mode 100644 index 000000000..f1f294b17 --- /dev/null +++ b/survey_upload_file/views/survey_question_views.xml @@ -0,0 +1,23 @@ + + + + + survey.question.view.form.inherit.survey.upload.file + survey.question + + + +
+

Upload Files + +

+
+
+ + + +
+
+
diff --git a/survey_upload_file/views/survey_templates.xml b/survey_upload_file/views/survey_templates.xml new file mode 100644 index 000000000..b6c43691b --- /dev/null +++ b/survey_upload_file/views/survey_templates.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + diff --git a/survey_upload_file/views/survey_user_views.xml b/survey_upload_file/views/survey_user_views.xml new file mode 100644 index 000000000..be764c5b7 --- /dev/null +++ b/survey_upload_file/views/survey_user_views.xml @@ -0,0 +1,20 @@ + + + + + survey.user_input.line.view.form.inherit.survey.upload.file + survey.user_input.line + + + + + + + + + + + + + +