[FIX] project_task_portal_form: allow multiple uploads in portal

This commit is contained in:
clementthomas
2023-03-28 14:39:45 +02:00
committed by clementelabore
parent ed987d03b9
commit 5e7af745c9
2 changed files with 11 additions and 7 deletions

View File

@@ -84,12 +84,7 @@ class PortalTaskCreation(CustomerPortal):
if values.get("bug_report", False):
description = description + "<br/><br/><b>BUG REPORT:</b><br/>" + values["bug_report"]
values["description"] = description
values["attachments"] = []
for field_name, field_value in request.params.items():
# If the value of the field if a file
if field_name == 'attachment' and field_value != "":
field_value.field_name = field_name
values["attachments"].append(field_value)
values["attachments"] = request.httprequest.files.getlist("attachment")
return values
@http.route(

View File

@@ -4,7 +4,16 @@
<t t-call="portal.portal_layout">
<!-- <div id="wrap" class="col-lg-6 container"></div> -->
<t t-set="additional_title">Task creation form</t>
<form action="/task/create" method="post" accept-charset="UTF-8" class="s_website_form col-md-12 mt32" data-model_name="project.task" data-force_action="" data-success_page="" enctype="multipart/form-data">
<form
action="/task/create"
method="post"
accept-charset="UTF-8"
class="s_website_form col-md-12 mt32"
data-model_name="project.task"
data-force_action=""
data-success_page=""
enctype="multipart/form-data">
<div class="oe_structure" id="oe_structure_portal_task_creation_form_1" />
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()" />
<div class="row">