[IMP] survey_extra_fields: new params max_file_size and allowed_extensions for file question type
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m45s

This commit is contained in:
2026-02-18 17:49:33 +01:00
parent e45bccc3e3
commit b63b8ba885
9 changed files with 241 additions and 8 deletions

View File

@@ -1,11 +1,17 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from __future__ import annotations
import base64
from typing import TYPE_CHECKING, Any
from odoo import http
from odoo.http import request, content_disposition
from odoo.addons.survey.controllers.main import Survey
if TYPE_CHECKING:
from werkzeug.wrappers import Response
class SurveyExtraFieldsController(Survey):
@@ -14,7 +20,13 @@ class SurveyExtraFieldsController(Survey):
type="http",
auth="public",
)
def survey_file_download(self, survey_token, answer_token, line_id, **kwargs):
def survey_file_download(
self,
survey_token: str,
answer_token: str,
line_id: int,
**kwargs: Any
) -> Response:
survey = request.env["survey.survey"].sudo().search(
[("access_token", "=", survey_token)], limit=1
)