The file extension detection previously used to determine whether a filename required an extension was not very smart and in fact only checked for a dot in the filename. `mimetypes.guess_type` is now used on the filename to better determine whether the filename still needs a file extension or not. This commit is a follow-up to: https://github.com/odoo/odoo/pull/90614 Which aimed to fix the same issue. TaskId-2826061 closes odoo/odoo#91254 X-original-commit: bf904a7f98ba5bcc0a8909cca3241e2965c4464c Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com> Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>