Wednesday, June 1, 2022
23 changes · master
Enhancements to existing features
Odoo can now hand off delivery of static files and attachments to the front-end web server when configured to do so. This reduces the load on Odoo workers, helping systems stay responsive during heavy file or image traffic while preserving Odoo's access checks.
Original PR description
Suggested review order: 1. odoo/tools/_vendor/send_file.py 2. odoo/http.py 3. odoo/addons/base/models/ir_binary.py 4. odoo/addons/base/models/ir_attachment.py 5. addons/web/controllers/binary.py 6.…
Suggested review order:
1. odoo/tools/_vendor/send_file.py
2. odoo/http.py
3. odoo/addons/base/models/ir_binary.py
4. odoo/addons/base/models/ir_attachment.py
5. addons/web/controllers/binary.py
6. odoo/addons/base/models/ir_http.py
7. odoo/addons/test_http/data.xml
8. odoo/addons/test_http/tests/test_static.py
Then the other files in any order.
Note that `website_slides/models/ir_http.py` was fixing a bug that does not exist anymore in master (verified with the original fix author)
---
Rationales
----------
Web servers can serve some resources (e.g. static files) right away
without any interaction with the web application. The network model of
most web servers makes them capable of handling thousands of
simultaneous requests when it comes to intensive IO operations such as
streaming data from a file. The network model of Odoo is different: it
is capable of a lot of processing power but can only serve a handful of
requests at a time, i.e. Odoo (with some help from postgres) is
optimized for CPU operations, not IO.
Some users don't configure their web server, they use a basic
configuration that relay all requests to Odoo. The result is that many
Odoo HTTP Workers can be busy streaming static files instead of
processing other requests. This can lead to a worker starvation, i.e.
all workers are busy streaming files and cannot process new requests.
X-Sendfile
----------
In this work, we add the support for the [X-Sendfile] header family,
they are multiples http headers that can be used by the web application
to communicate with the web server in order to delegate the delivery of
files stored on the file system. Odoo still receives the request but it
does no more stream the file content from within its HTTP worker,
instead it skips the response body altogether and sets the `X-Sendfile`
special header with the path of the file on the filesystem. The web
server intercepts that special header, open the file and stream it.
Using those headers, we can use the best of both the web application and
the web server. The web application is still responsible to locate the
resource and verify the access rights, the web server is still
responsible of streaming the content.
Using X-Sendfile is opt-in via the `--x-sendfile` CLI flag. We set both
`X-Sendfile` (apache) and `X-Accel-Redirect` (nginx). If you are using
apache, make sure `mod_xsendfile` is enabled. If you are using NGINX
you have to add the following location block:
location /web/filestore { # custom path, hardcoded within Odoo
# Prevent access from the outside world, i.e. makes this
# route only accessible via X-Accel. MANDATORY!!!
internal;
# Give access to the filestore using this server's
# permissions. Odoo is in charge of verifying the access
# rights.
alias /path/to/odoo/data-dir/filestore;
}
The Odoo [deployment documentation] has been updated accordingly.
[X-Sendfile]: https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile/
[deployment documentation]: https://www.odoo.com/documentation/master/administration/install/deploy.html#serving-static-files-and-attachments
Changes to the API
------------------
To benefit most from X-Sendfile, all APIs related to streaming content
over HTTP has to be adapted. They are: (1) `request._serve_static`,
(2) `ir.http._serve_fallback`, (3) `/web/content` and (4) `/web/image`.
Each used it own way to deliver content: (1) `_serve_static` was using
`send_file` (flask's send_file that as been vendored with odoo 10
years ago and not maintenained since then), (2) _serve_fallback was
handcrafting a `werkzeug.wrappers.Response`, (3) /web/content-image were
using the "binary server" `ir.http.binary_content` API.
I has been decided to remove all 3 APIs and to merge the code inside of
the new `http.Stream` object and the `ir.binary` helper model.
A Stream wraps what is going to be sent to the browser, it can be a path
to a file on the locale filesystem, a blob of raw data or an URL to an
external resource. The Stream also holds various metadata that are
mainly used for caching. The preferred way to create a Stream is via one
of its three factories so that all the metadata are set. The factories
are: `from_path`, `from_attachment` and `from_binary_field`. A stream
instance exposes a single method `get_response()` used to create the
corresponding HTTP response object out of the stream.
Inside of `ir.http` were a few methods that were not related to the http
routing and formed what was called the "binary server". All those
methods have been removed and the feature have been refactored inside of
the new `ir.binary` model. The removed methods are:
- `_xmlid_to_obj`
- `_get_record_and_check`
- `_binary_ir_attachment_redirect_content`
- `_binary_record_content`
- `_binary_set_headers`
- `binary_content`
- `_response_by_status`
- `_get_content_common`
- `_content_image`
- `_content_image_get_response`
- `_placeholder_image_get_response`
The new `ir.binary` abstract model exposes the following utilities:
**`_find_record`**
Find an attachment or a record with a binary-field out of an xmlid or
out of a pair record-model/record-id. Check the access rights and the
access token.
**`_get_stream_from`**
Create a Stream from an attachment or a record with a binary-field.
**`_get_image_stream_from`**
Same as `_get_stream_from` but adapted for images. It sets a sensible
ETag on the stream and has image resizing support.
**`_placeholder`**
Get the image placeholder blob.
Testing
-------
It is possible to test the web server configuration using the
`test_http` module. Install the module then run the unittest using the
`webserver` test-tag. By default it attempts to connect to a web-server
running on `http://localhost:80`, you can change this URL by setting the
`WEB_SERVER_URL` environment variable.
odoo-bin -i test_http --stop-after-init
WEB_SERVER_URL='http://localhost:80' odoo-bin --test-tags webserver --stop-after-init
Task: 2801675This update makes error messages more specific when a report or grouped view cannot use a selected field. Instead of requiring technical debugging to identify the problem field, the message now points directly to it, helping teams resolve configuration issues faster.
Original PR description
Avoid to debug to find which field is not stored. **Description of the issue/feature this PR addresses:** Avoid to debug to find which field is not stored. Normally, you have one field in the 'groupby' clause, but you may have more than one. **Current behavior before PR:** In case you get that error, you then have to debug to know which field is causing the error, which is a waste of time. **Desired behavior after PR is merged:** The error shows which field is causing the error. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Messages in Discuss now show all relevant recipients when appropriate, reducing uncertainty about whether everyone intended was included. This improves transparency for users working with mail and project-related communications.
Original PR description
All the recipients of message were not always displayed in discuss and some users were wondering if the message has been sent to everybody concerned. This solves the problem by allowing to specify whether to display all recipients based on the message sub type and defining for which sub type it must. Task-2429708 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Users can now download image attachments directly from the chatter by hovering over the image and clicking a download icon. This makes saving shared images quicker and more discoverable without changing the underlying attachment workflow.
Original PR description
**Current behavior before PR:** Improve how image attachments are downloaded from the chatter by adding the `download` button when hovering image files **Desired behavior after PR is merged:** add a `Download` button (icon) on the bottom right corner of image attachments on hover Task-2802810 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Customer rating updates that trigger a notification are now shown directly in the systray preview. This helps users quickly understand feedback outcomes at a glance using familiar rating faces, without opening the full conversation.
Original PR description
Display the rating changes that generate a notification under the systray. Using the rating faces to represent the result. task-2794182 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update clarifies internal documentation for a mail testing helper related to screen size handling. It helps maintain reliable automated tests while avoiding changes to customer-facing behavior.
Original PR description
patchUiSize used to patch both legacy and wowl sizes (browser, env.device, ...). Now that the wowl env is used in the discuss app, patching the legacy sizes is useless. This PR cleans this dead code.
Users can now drag and drop files anywhere in the chatter to upload them, making attachments easier to discover and use. The file area labels were also clarified and now show either an attachment prompt or the number of files already linked to the record.
Original PR description
**PURPOSE** The attachment icon in the chatter is too discrete, a lot of users easily miss it. **SPECIFICATIONS** - Allow for file upload through drag and drop and the whole chatter. It doesn't matter whether the file tray is unfolded. Hence, removed DropZone on attachmentBox as now have DropZone on the whole chatter. - On the file tray, rename "Attachments" to "Files" and "Add attachments" to "Attach files". - When there are files attached to the record, display "X files". - when there is no file yet, display 'Attach files'. Although clicking on it opens the file explorer, but doesn't unfold the tray yet. Once the file is submitted, the file tray unfolds to show confirmed upload to the user. Task-2413814 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update removes an unnecessary layout setting from the Discuss app's full-screen view. It keeps the screen behavior the same while simplifying the underlying styling, reducing maintenance overhead for future changes.
Original PR description
DiscussContainer is specific component for content of Discuss app in "whole screen" client action. The parent is not flex, so it needs `h-100` to take the whole screen. Consequently, `min-height: 0` is useless, hence this commit removes it.
Canceled sales orders and invoices can no longer be paid through existing payment links. When a customer opens a payment link for a canceled document, the payable amount is set to zero, reducing accidental or invalid payments.
Original PR description
Before this commit, sales orders/invoices that had been canceled could
still be paid from a payment link. Now, when trying to pay for a
canceled sales order/invoice, the amount to pay is set to zero.
Task - 2735019The mail module now includes a shared throttling mechanism to better manage repeated actions and updates. This helps keep messaging interactions smoother and more reliable by preventing unnecessary rapid processing behind the scenes.
Original PR description
Task-2831082
Tax searches now ignore punctuation and spaces, making it easier to find the right tax while editing invoices or configuring tax settings. Users can type compact shortcuts like “21M” or “0EUT” and still see matching tax names with symbols, spaces, or punctuation.
Original PR description
This PR improves tax name search by ignoring punctuation and spaces. This allows faster searching for taxes (while editing an invoice line or while configuring them) Example: Searching for `21M` should match `21% M.` , `21% EU M.` and `21% M.Cocont`. Searching for `0EUT` should match `0% EU T`. Task id: 2851341
Course publishing is now better synchronized with linked products, preventing shared products from being unpublished too aggressively and keeping eligible learners' access intact. When a course cannot be purchased because its product is unpublished, the storefront now shows clearer messaging for customers and administrators.
Original PR description
This commit adds a couple improvement to the "publish" flow of courses: - Improve the published synchronization between the course and its product - Adapt wording when the course is unavailable on the frontend view See underlying commits for details. task-2842624
The eLearning course interface now uses clearer wording by replacing technical “slide” language with “content” and protects key action buttons from accidental edits. Certification creation is smoother, guiding users directly to add survey questions after creating a certification.
Original PR description
- Added o_not_editable class to buttons to prevent them from being edited - Changed the word 'slide' to 'content' at various locations - Changed the button redirecting to the certification of the full screen mode to match the button of the regular screen mode - Changed the text of the button suggesting to install the survey module when adding a new content - Fixed several missalignments - Changed the modal opened after that the survey module installation suggestion button has been used. Now opens the certification upload modal. - Added a redirection to the linked survey when a certification is created, as well as a button on the page suggesting to add questions to the survey when the user has been redirected after the certification creation.
This update improves day-to-day manufacturing and repair workflows with clearer labels, better filtering of inactive operations, and more reliable transfer creation. Repair users can now manually select valid return pickings, helping reduce mistakes and follow-up corrections.
Original PR description
[IMP] mrp, repair: various back2basics fixes MRP back to basics small fixes and improvements, see individual commits for more details Task Id: 2825321 Enterprise PR: https://github.com/odoo/enterprise/pull/27577 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Event attendees now get clearer next steps after registering, reducing dead ends. Free event confirmations link back to the event, while paid event confirmations show the events purchased so customers can easily review what they bought.
Original PR description
Purpose ======= Avoid having "dead-ends" when registering to an event. Specifications ============= Add link to event to registration confirmation for free events. Display list of each bought event on the confirmation page for paid events. Task-2657635
Tax searches now ignore spaces and punctuation, making it easier to find the right tax by typing short codes like 21M or 0EUT. This helps users work faster when editing invoice lines or configuring tax settings.
Original PR description
This PR improves tax name search by ignoring punctuation and spaces. This allows faster searching for taxes (while editing an invoice line or while configuring them) Example: Searching for `21M` should match `21% M.` , `21% EU M.` and `21% M.Cocont`. Searching for `0EUT` should match `0% EU T`. Task id: 2851341 Old PR with remarks: https://github.com/odoo/odoo/pull/91667
The EC sales report now provides clearer totals, more specific error categories, and direct links to the accounting entries behind issues. Belgian reporting also gains an automated consistency check against the tax report, helping finance teams validate filings more easily.
Original PR description
- Refactor _process_query_result to avoid code repetition in BE report, generic report and base report. - Correct typos. - Add Total line. - Split 'same country' and 'non ec country' single error int two distinct errors. - Add links to aml's moves causing errors. - For belgian report, cross check results with tax report where ec sale report total must equal tax report lines 44 + 46L + 46T - (48s44 + 48s46L + 48s46T). - Allow auditing each report line. Task: 2730151
This update improves internal spreadsheet test files so development tools can better understand them. It helps maintain code quality and reduces noise for developers, with no expected change for end users.
Original PR description
Very usefull if you have a tsconfig.json file, otherwise everything is red :) Co-authored-by: Rémi Rahir <rar@odoo.com>
Project milestones can now be connected to the tasks that contribute to them, giving teams a clearer view of progress toward key project goals. Field Service projects keep milestones disabled by default, while reporting now makes it easier to search and group planning and timesheet data by milestone.
Original PR description
Purpose ======= The goal of this PR is to create a link between milestones and tasks. Indeed, milestones usually contain a set of tasks. Once all of these tasks are done, the milestone can be considered as reached. This link would help users organize their projects more efficiently and have a better overview of what needs to be done when. ## Implementation details The implementation is the continuity of odoo/odoo#90972 to use the milestones feature in the enterprise views and also in Fields Services app or even in `Timesheets and Planning analysis` report (by adding the quick search on milestone linked to task and the group by Milestones). However, the `Milestones` feature and also avoid enabling the Milestones feature on fsm project by default. task-2829542
The manufacturing work order timer setting is now shown in the manufacturing settings area, making it easier for users to find and manage. The subscription label on analytic account forms was updated to a clearer sales-related wording.
Original PR description
[IMP] mrp_workorder, sale_subscription: back2basics mrp_workorder: The timer setting was moved to mrp instead of stock sale_subscription: label changed Task Id: 2825321 COM PR: https://github.com/odoo/odoo/pull/91879
Website appointment pages now apply a site's custom background color more consistently across the booking flow. Visual elements such as cards and readable sections adapt better to theme colors, helping maintain a polished and legible customer experience.
Original PR description
PURPOSE: When using a custom background color, it is now used everywhere in website appointment. To maintain good readability, some components have now a style that depends on the theme's colors. Task-2835882
This update adjusts automated checks for the mail chatter's file drag-and-drop behavior. It helps ensure attachment previews continue to work reliably as the drag-and-drop experience is improved.
Original PR description
qunit adapt Task-2413814
Static files used by Documents, Instagram integration, and push notifications are now handed off to the main web delivery mechanism instead of being served directly by each feature. This should improve consistency and performance while reducing maintenance complexity behind the scenes.
Original PR description
Task: 2801675 See odoo/odoo#88134