Compare commits

..

No commits in common. "19.0" and "main" have entirely different histories.
19.0 ... main

9 changed files with 11 additions and 38 deletions

15
.gitignore vendored
View File

@ -1,15 +0,0 @@
# Python
*.py[cod]
__pycache__/
*.so
# Odoo
*.po~
*.pot~
# Editor / System
.DS_Store
.vscode/
*.swp
*.swo
*~

View File

@ -1,6 +1,6 @@
{ {
'name': "Image File Upload In Survey", 'name': "Image File Upload In Survey",
'version': "19.0.1.0.3", 'version': "18.0.1.0.3",
'category': 'Extra Tools', 'category': 'Extra Tools',
'summary': 'Attachment of Image Files in Survey Form', 'summary': 'Attachment of Image Files in Survey Form',
'description': 'This module is used for attachments of image files in Survey Form, ' 'description': 'This module is used for attachments of image files in Survey Form, '

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,25 +1,12 @@
/** @odoo-module */ /** @odoo-module */
import { SurveyForm } from "@survey/interactions/survey_form"; import SurveyFormWidget from '@survey/js/survey_form';
import { patch } from "@web/core/utils/patch"; SurveyFormWidget.include({
/** Get all question answers by question type */
patch(SurveyForm.prototype, { _prepareSubmitValues(formData, params) {
/** this._super(...arguments);
* @override this.$('[data-question-type]').each(function () {
*/ if ($(this).data('questionType') === 'upload_file'){
prepareSubmitValues(formData, params) { params[this.name] = [$(this).data('oe-data'), $(this).data('oe-file_name')];
super.prepareSubmitValues(formData, params);
// Handle upload_file question type
this.el.querySelectorAll('[data-question-type="upload_file"]').forEach((el) => {
const oeData = el.getAttribute('data-oe-data');
const oeFileName = el.getAttribute('data-oe-file_name');
if (oeData && oeFileName) {
try {
params[el.name] = [JSON.parse(oeData), JSON.parse(oeFileName)];
} catch (e) {
// Fallback if not valid JSON
params[el.name] = [oeData, oeFileName];
}
} }
}); });
}, },

View File

@ -1,5 +1,6 @@
/** @odoo-module */ /** @odoo-module */
import publicWidget from "@web/legacy/js/public/public_widget"; 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"; import SurveyPreloadImageMixin from "@survey/js/survey_preload_image_mixin";
/** Extends publicWidget to create "SurveyFormUpload" */ /** Extends publicWidget to create "SurveyFormUpload" */
publicWidget.registry.SurveyFormUpload = publicWidget.Widget.extend(SurveyPreloadImageMixin, { publicWidget.registry.SurveyFormUpload = publicWidget.Widget.extend(SurveyPreloadImageMixin, {