9417edb7070424f489ffd78af270c73bfee3449e
To reproduce the problem: - ensures python-magic is not installed. It is used to guess the mime type of a file. The code uses an alternate solution if not present and this is that alternate version that's unable to guess the mime type of an xlsx file. - in website_slides, open a course - open a content - go to the "Additional Resources" tab - add an xlsx file - remove the extension of the file in the name - open the public website and open that content - click on the link of the file you just have added - instead of a xlsx, you get a zip file This fix solves the problem by using the extension of the file uploaded if it is valid. Technical note: prior version 16, the mime type stored in the attachment was used to determine the extension of the file when downloading it. From version 16, if the extension is missing in the file name, the system tries to guess it using python-magic if installed and a custom implementation if not: _odoo_guess_mimetype. The custom implementation doesn't support the detection of xlsx files (and other formats) while python-magic supports it. That's why the problem described above only appends while python-magic is not installed. To solve the problem we have added in the download URL the file name as the the name of the resource with the extension of the file name uploaded (extension not added if the name had already the same extension as the file name). Task-3200998 closes odoo/odoo#115273 X-original-commit: 3a7388a69991d968c349133be4ac52745bbac65b Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
…
…
…
…
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%