Skip to content
Snippets Groups Projects
Commit 9be29371 authored by Nans Lefebvre's avatar Nans Lefebvre Committed by fw-bot
Browse files

[FIX] website_form: multiple input files with same name


By default, the name of a file input field is 'Custom File Upload'.
If there are two fields with the same name, then they both end up in
self.form_fields with the name 'Custom File Upload[0]', and their values
are concatenated, which are file objects. So the concatenation of two
files is a String, ('[object File],[object File]'), because JavaScript.
(And if you don't like it you don't like the web nor human progress.)

The resulting bug is that instead of adding attachments to the created
record, it adds the string message to the notes.

Adding the outer loop index disambiguates the names, so that all
attachments are created as intended.

opw 2092653

closes odoo/odoo#39655

X-original-commit: 5df3f662
Signed-off-by: default avatarNans Lefebvre (len) <len@odoo.com>
parent 55c3d449
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment