diff --git a/survey_upload_file/README.rst b/survey_upload_file/README.rst new file mode 100644 index 000000000..263e45c52 --- /dev/null +++ b/survey_upload_file/README.rst @@ -0,0 +1,42 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +File Upload In Survey +===================== +This module is used for attachment of files in Survey Form + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License v3.0 (LGPL v3) +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +Developer: (V17) Mohammed Dilshad Tk@ 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..743cb69ee --- /dev/null +++ b/survey_upload_file/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (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 models diff --git a/survey_upload_file/__manifest__.py b/survey_upload_file/__manifest__.py new file mode 100644 index 000000000..d6767358a --- /dev/null +++ b/survey_upload_file/__manifest__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (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': "File Upload In Survey", + 'version': "18.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': { + 'survey.survey_assets': [ + 'survey_upload_file/static/src/js/survey_form_attachment.js', + 'survey_upload_file/static/src/js/SurveyFormWidget.js', + ], + }, + 'data': [ + 'views/survey_question_views.xml', + 'views/survey_user_views.xml', + 'views/survey_templates.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'LGPL-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..608989639 --- /dev/null +++ b/survey_upload_file/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 05.11.2024 +#### Version 18.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..9c454a5c2 --- /dev/null +++ b/survey_upload_file/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (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_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..7e6de1a24 --- /dev/null +++ b/survey_upload_file/models/survey_question.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (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 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..59b0100f7 --- /dev/null +++ b/survey_upload_file/models/survey_user_input.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (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 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, + overwrite_existing=False): + """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_simple_answer(question, old_answers, answer) + else: + res = super()._save_lines(question, answer, comment, + overwrite_existing) + return res + + def _save_line_simple_answer(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..779615f96 --- /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) 2025-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (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 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/arrows-repeat.svg b/survey_upload_file/static/description/assets/icons/arrows-repeat.svg new file mode 100755 index 000000000..1d7efabc5 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/survey_upload_file/static/description/assets/icons/banner-1.png b/survey_upload_file/static/description/assets/icons/banner-1.png new file mode 100755 index 000000000..c180db172 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/banner-1.png differ diff --git a/survey_upload_file/static/description/assets/icons/banner-2.svg b/survey_upload_file/static/description/assets/icons/banner-2.svg new file mode 100755 index 000000000..e606d97d9 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/survey_upload_file/static/description/assets/icons/banner-bg.png b/survey_upload_file/static/description/assets/icons/banner-bg.png new file mode 100755 index 000000000..a8238d3c0 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/banner-bg.png differ diff --git a/survey_upload_file/static/description/assets/icons/banner-bg.svg b/survey_upload_file/static/description/assets/icons/banner-bg.svg new file mode 100755 index 000000000..b1378103e --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/survey_upload_file/static/description/assets/icons/banner-call.svg b/survey_upload_file/static/description/assets/icons/banner-call.svg new file mode 100755 index 000000000..96c687e81 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/survey_upload_file/static/description/assets/icons/banner-mail.svg b/survey_upload_file/static/description/assets/icons/banner-mail.svg new file mode 100755 index 000000000..cbf0d158d --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/survey_upload_file/static/description/assets/icons/banner-pattern.svg b/survey_upload_file/static/description/assets/icons/banner-pattern.svg new file mode 100755 index 000000000..9c1c7e101 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/survey_upload_file/static/description/assets/icons/banner-promo.svg b/survey_upload_file/static/description/assets/icons/banner-promo.svg new file mode 100755 index 000000000..d52791b11 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/survey_upload_file/static/description/assets/icons/brand-pair.svg b/survey_upload_file/static/description/assets/icons/brand-pair.svg new file mode 100755 index 000000000..d8db7fc1e --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 100755 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 100755 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/close-icon.svg b/survey_upload_file/static/description/assets/icons/close-icon.svg new file mode 100755 index 000000000..df8cce37a --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + 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 100755 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/collabarate-icon.svg b/survey_upload_file/static/description/assets/icons/collabarate-icon.svg new file mode 100755 index 000000000..dd4e10518 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + 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 100755 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/cybro-logo.png b/survey_upload_file/static/description/assets/icons/cybro-logo.png new file mode 100755 index 000000000..ff4b78220 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/cybro-logo.png differ diff --git a/survey_upload_file/static/description/assets/icons/down.svg b/survey_upload_file/static/description/assets/icons/down.svg new file mode 100755 index 000000000..f21c36271 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file 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 100755 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 100755 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/faq.png b/survey_upload_file/static/description/assets/icons/faq.png new file mode 100755 index 000000000..4250b5b81 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/faq.png differ diff --git a/survey_upload_file/static/description/assets/icons/feature-icon.svg b/survey_upload_file/static/description/assets/icons/feature-icon.svg new file mode 100755 index 000000000..fa0ea6850 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/survey_upload_file/static/description/assets/icons/feature.png b/survey_upload_file/static/description/assets/icons/feature.png new file mode 100755 index 000000000..ac7a785c0 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/feature.png differ diff --git a/survey_upload_file/static/description/assets/icons/gear.svg b/survey_upload_file/static/description/assets/icons/gear.svg new file mode 100755 index 000000000..0cc66b6ea --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/survey_upload_file/static/description/assets/icons/hero.gif b/survey_upload_file/static/description/assets/icons/hero.gif new file mode 100755 index 000000000..380654dfe Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/hero.gif differ diff --git a/survey_upload_file/static/description/assets/icons/hire-odoo.svg b/survey_upload_file/static/description/assets/icons/hire-odoo.svg new file mode 100755 index 000000000..e1ac089b0 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + 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 100755 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 100755 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/life-ring-icon.svg b/survey_upload_file/static/description/assets/icons/life-ring-icon.svg new file mode 100755 index 000000000..3ae6e1d89 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + 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 100755 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/mail.svg b/survey_upload_file/static/description/assets/icons/mail.svg new file mode 100755 index 000000000..1eedde695 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + 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 100755 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/notes.png b/survey_upload_file/static/description/assets/icons/notes.png new file mode 100755 index 000000000..ee5e95404 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/notes.png differ diff --git a/survey_upload_file/static/description/assets/icons/notification icon.svg b/survey_upload_file/static/description/assets/icons/notification icon.svg new file mode 100755 index 000000000..053189973 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/survey_upload_file/static/description/assets/icons/odoo-consultancy.svg b/survey_upload_file/static/description/assets/icons/odoo-consultancy.svg new file mode 100755 index 000000000..e05f65bde --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/survey_upload_file/static/description/assets/icons/odoo-licencing.svg b/survey_upload_file/static/description/assets/icons/odoo-licencing.svg new file mode 100755 index 000000000..2606c88b0 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/survey_upload_file/static/description/assets/icons/odoo-logo.png b/survey_upload_file/static/description/assets/icons/odoo-logo.png new file mode 100755 index 000000000..0e4d0eb5a Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/odoo-logo.png differ diff --git a/survey_upload_file/static/description/assets/icons/patter.svg b/survey_upload_file/static/description/assets/icons/patter.svg new file mode 100755 index 000000000..25c9c0a8f --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/survey_upload_file/static/description/assets/icons/pattern1.png b/survey_upload_file/static/description/assets/icons/pattern1.png new file mode 100755 index 000000000..09ab0fb2d Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/pattern1.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 100755 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-piece-icon.svg b/survey_upload_file/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100755 index 000000000..3e9ad9373 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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 100755 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/replace-icon.svg b/survey_upload_file/static/description/assets/icons/replace-icon.svg new file mode 100755 index 000000000..d0e3a7af1 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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 100755 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/screenshot-main.png b/survey_upload_file/static/description/assets/icons/screenshot-main.png new file mode 100755 index 000000000..575f8e676 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/screenshot-main.png differ diff --git a/survey_upload_file/static/description/assets/icons/screenshot.png b/survey_upload_file/static/description/assets/icons/screenshot.png new file mode 100755 index 000000000..cef272529 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/screenshot.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 100755 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/skype-fill.svg b/survey_upload_file/static/description/assets/icons/skype-fill.svg new file mode 100755 index 000000000..c17423639 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/survey_upload_file/static/description/assets/icons/skype.png b/survey_upload_file/static/description/assets/icons/skype.png new file mode 100755 index 000000000..51b409fb3 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/skype.png differ diff --git a/survey_upload_file/static/description/assets/icons/skype.svg b/survey_upload_file/static/description/assets/icons/skype.svg new file mode 100755 index 000000000..df3dad39b --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/survey_upload_file/static/description/assets/icons/star-1.svg b/survey_upload_file/static/description/assets/icons/star-1.svg new file mode 100755 index 000000000..7e55ab162 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/survey_upload_file/static/description/assets/icons/star-2.svg b/survey_upload_file/static/description/assets/icons/star-2.svg new file mode 100755 index 000000000..5ae9f507a --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/survey_upload_file/static/description/assets/icons/support.png b/survey_upload_file/static/description/assets/icons/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/support.png differ diff --git a/survey_upload_file/static/description/assets/icons/test-1 - Copy.png b/survey_upload_file/static/description/assets/icons/test-1 - Copy.png new file mode 100755 index 000000000..f6a902663 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/test-1 - Copy.png differ diff --git a/survey_upload_file/static/description/assets/icons/test-1.png b/survey_upload_file/static/description/assets/icons/test-1.png new file mode 100755 index 000000000..0908add2b Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/test-1.png differ diff --git a/survey_upload_file/static/description/assets/icons/test-2.png b/survey_upload_file/static/description/assets/icons/test-2.png new file mode 100755 index 000000000..4671fe91e Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/test-2.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 100755 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 100755 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/translate.svg b/survey_upload_file/static/description/assets/icons/translate.svg new file mode 100755 index 000000000..af9c8a1aa --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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 100755 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 100755 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/video.png b/survey_upload_file/static/description/assets/icons/video.png new file mode 100755 index 000000000..576705b17 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/video.png differ diff --git a/survey_upload_file/static/description/assets/icons/whatsapp.png b/survey_upload_file/static/description/assets/icons/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/survey_upload_file/static/description/assets/icons/whatsapp.png differ diff --git a/survey_upload_file/static/description/assets/icons/wrench-icon.svg b/survey_upload_file/static/description/assets/icons/wrench-icon.svg new file mode 100755 index 000000000..174b5a465 --- /dev/null +++ b/survey_upload_file/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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 100755 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/modules/1.gif b/survey_upload_file/static/description/assets/modules/1.gif new file mode 100755 index 000000000..ae3a880a2 Binary files /dev/null and b/survey_upload_file/static/description/assets/modules/1.gif differ diff --git a/survey_upload_file/static/description/assets/modules/2.gif b/survey_upload_file/static/description/assets/modules/2.gif new file mode 100755 index 000000000..d19e2b352 Binary files /dev/null and b/survey_upload_file/static/description/assets/modules/2.gif 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 100755 index 000000000..8513873ea 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 100755 index 000000000..3bedf7981 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 100755 index 000000000..0e311ca87 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.jpg b/survey_upload_file/static/description/assets/modules/6.jpg new file mode 100755 index 000000000..67c7f7062 Binary files /dev/null and b/survey_upload_file/static/description/assets/modules/6.jpg differ diff --git a/survey_upload_file/static/description/assets/screenshots/hero.gif b/survey_upload_file/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..2f3b7d250 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/hero.gif differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey1.png b/survey_upload_file/static/description/assets/screenshots/survey1.png new file mode 100644 index 000000000..304d0552e Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey1.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey10.png b/survey_upload_file/static/description/assets/screenshots/survey10.png new file mode 100644 index 000000000..7b707c049 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey10.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey11.png b/survey_upload_file/static/description/assets/screenshots/survey11.png new file mode 100644 index 000000000..4a0912844 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey11.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey12.png b/survey_upload_file/static/description/assets/screenshots/survey12.png new file mode 100644 index 000000000..40232e334 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey12.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey13.png b/survey_upload_file/static/description/assets/screenshots/survey13.png new file mode 100644 index 000000000..3c751adf1 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey13.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey14.png b/survey_upload_file/static/description/assets/screenshots/survey14.png new file mode 100644 index 000000000..a0077c318 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey14.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey15.png b/survey_upload_file/static/description/assets/screenshots/survey15.png new file mode 100644 index 000000000..9b69e5841 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey15.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey2.png b/survey_upload_file/static/description/assets/screenshots/survey2.png new file mode 100644 index 000000000..5895eb830 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey2.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey3.png b/survey_upload_file/static/description/assets/screenshots/survey3.png new file mode 100644 index 000000000..2b847bdd2 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey3.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey4.png b/survey_upload_file/static/description/assets/screenshots/survey4.png new file mode 100644 index 000000000..4f48de75e Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey4.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey5.png b/survey_upload_file/static/description/assets/screenshots/survey5.png new file mode 100644 index 000000000..1d0e21c2a Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey5.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey6.png b/survey_upload_file/static/description/assets/screenshots/survey6.png new file mode 100644 index 000000000..6d23123e5 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey6.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey7.png b/survey_upload_file/static/description/assets/screenshots/survey7.png new file mode 100644 index 000000000..4311532c6 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey7.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey8.png b/survey_upload_file/static/description/assets/screenshots/survey8.png new file mode 100644 index 000000000..98b9653e2 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey8.png differ diff --git a/survey_upload_file/static/description/assets/screenshots/survey9.png b/survey_upload_file/static/description/assets/screenshots/survey9.png new file mode 100644 index 000000000..7643b9e70 Binary files /dev/null and b/survey_upload_file/static/description/assets/screenshots/survey9.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..b17963eaa 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..6b30822b3 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..bba05c2fc --- /dev/null +++ b/survey_upload_file/static/description/index.html @@ -0,0 +1,1107 @@ + + + + + + File Upload In Survey + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+
+
+ +
+
+
+
+

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

+

File Upload In Survey +

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

Key + Highlights

+
+
+
+
+ +
+

+ User can upload file for survey + questions.

+
+
+
+
+
+ +
+

+Upload single file as answer for survey + questions.

+
+
+
+
+
+ +
+

+Participants can view their answer in the + 'review your answers' button in Survey form.

+
+
+
+
+
+ +
+

+Upload multiple file as answer for survey questions.

+
+
+
+
+ +
+
+
+ File Upload In Survey +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ Single Attachment Download +

+
+
+

+ 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 Attachments Download +

+
+ +
+

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

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

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

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

+User can upload file for survey questions.

+ +
+
+
+
+
+
+ +
+

+ Upload single file as answer for survey + questions.

+
+
+
+
+
+
+
+ +
+

+ Upload multiple file as answer for survey questions.

+
+
+
+
+
+
+ +
+
+

+ Latest Release 18.0.1.0.0 +

+ + 30th October, 2024 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + diff --git a/survey_upload_file/static/src/js/SurveyFormWidget.js b/survey_upload_file/static/src/js/SurveyFormWidget.js new file mode 100644 index 000000000..e4c8e7d32 --- /dev/null +++ b/survey_upload_file/static/src/js/SurveyFormWidget.js @@ -0,0 +1,13 @@ +/** @odoo-module */ +import SurveyFormWidget from '@survey/js/survey_form'; +SurveyFormWidget.include({ + /** Get all question answers by question type */ + _prepareSubmitValues(formData, params) { + this._super(...arguments); + 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/static/src/js/survey_form_attachment.js b/survey_upload_file/static/src/js/survey_form_attachment.js new file mode 100644 index 000000000..671bfaa09 --- /dev/null +++ b/survey_upload_file/static/src/js/survey_form_attachment.js @@ -0,0 +1,61 @@ +/** @odoo-module */ +import publicWidget from "@web/legacy/js/public/public_widget"; +import SurveyFormWidget from '@survey/js/survey_form'; +import SurveyPreloadImageMixin from "@survey/js/survey_preload_image_mixin"; +/** Extends publicWidget to create "SurveyFormUpload" */ +publicWidget.registry.SurveyFormUpload = publicWidget.Widget.extend(SurveyPreloadImageMixin, { + selector: '.o_survey_form', + events: { + 'change .o_survey_upload_file': '_onFileChange', + }, + init() { + this._super(...arguments); +// this.rpc = this.bindService("rpc"); + }, + /** 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); + } + } + }, + }); +export default publicWidget.registry.SurveyFormUpload; 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..39e9672e7 --- /dev/null +++ b/survey_upload_file/views/survey_question_views.xml @@ -0,0 +1,22 @@ + + + + + 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..8ffaaf51c --- /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..ea1426ca2 --- /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 + + + + + + + + + + + + + +